Changes between Version 23 and Version 24 of Developer/Git

Feb 1, 2012, 11:52:44 PM (8 years ago)

/* GIT Access for contributors */


  • Developer/Git

    v23 v24  
    229229TODO: Some guidelines for anyone who wishes to contribute to rtems... Patches? Pull Requests?...
    230 =  GIT Push Configuration  =
    233 People with write access to the main repository should make sure that they push the right branch with the
    234  git push
    235 command.  Lets suppose we have an ''upstream'' branch intended for integration into the ''master'' branch of the main repository, then we can check the configuration with the following command
    236  git remote show origin
    237 which may print out
     231The preferred workflow for making changes to RTEMS is to push patches to a committer's personal repository in public view and then merge changes from there.
     232=  SSH Access  =
     234Currently all committer's should have an ssh account on the main git server,  If not then one should be requested. SSH access for git uses key logins instead of passwords. (Add some info/links to ssh key generation and management.)
     235=  Personal Repository  =
     237Each committer should maintain a personal clone of the RTEMS repository to which all changes meant to be merged into the RTEMS head are sent. The following instructions show how to setup a personal repository that by default causes commits to go to your private local repository and pushes to go to your publicly visible personal repository. The RTEMS head is configured as a remote repository named 'upstream' to which you can push changes that have been approved for merging into RTEMS.
     239Branches aren't automatically pushed until you tell git to do the initial push after which the branch is pushed automatically. In order to keep code private just put it on a branch and do not push the branch.
     240=  Create a personal repository  =
     242Set up the server side repository. In the following substitute user with your username.
     244# ssh
     245[user@git ~]$ ln -s /data/git/user git
     246[user@git ~]$ ls -l
     247lrwxrwxrwx 1 user rtems 16 Feb  1 11:52 git -> /data/git/user
     248[user@git ~]$ cd git
     249[user@git git]$ git clone --mirror /data/git/rtems.git
     251Provide a description for the repository, for example "Clone of master repository."
     253[user@git git]$ echo "Clone of master repository." > rtems.git/description
     254[user@git git]$ logout
     256Clone the repository on your local machine
     258# git clone ssh://
     259# cd rtems
     261Add the RTEMS repository as a remote repository and get the remote tags and branches
     263# git remote add upstream ssh://
     264# git fetch upstream
     267After a little while you should be able to see your personal repo at and you can create other repositories in your git directory that will propagate to if you need.
     268=  Check your setup  =
     271git remote show origin
     273Should print something similar to
    238275 * remote origin
    239    Fetch URL:
    240    Push  URL:
     276   Fetch URL: ssh://
     277   Push  URL: ssh://
    241278   HEAD branch: master
    242279   Remote branches:
    246283     master tracked
    247284   Local branch configured for 'git pull':
    248      upstream merges with remote master
     285     master merges with remote master
    249286   Local ref configured for 'git push':
    250      upstream pushes to master (up to date)
    252 Here you can see that you pull from the remote ''master'' branch into your local ''upstream'' branch and push in the other direction.  After the clone of the repository the ''master'' branch will be used as the default push branch.  You can change this with
    253  git config remote.origin.push upstream:master
     287     master pushes to master (up to date)
     289=  Update from remote master (head)  =
     292# git fetch upstream
     293# git merge upstream/master
     295=  Push commits to personal repo master from local master  =
     298# git push
     300=  Push a branch onto personal repo  =
     303# git push origin branchname
     305=  Push your changes to upstream (RTEMS head)  =
     308# git push upstream master
     310If someone pushed since you updated the server rejects your push until you are up to date.
     311=  GIT Push Configuration  =
     314People with write access to the main repository should make sure that they push the right branch with the git push command. The above setup ensures that git push will not touch the main repository, which is identified as upstream, unless you specify the upstream (by git push upstream master).
     316Lets suppose we have a ''test'' branch intended for integration into the ''master'' branch of the main repository.
     318# git branch
     319  master
     320 *  test
     322There are two options for pushing with the branch. First,
     324# git push origin test
     326Will push the test branch to the personal repository. To delete the remote repository
     328# git push origin :test
     330You'll still need to delete your local branch if you are done with it.
     332If you are going to work exclusively with one branch for awhile, you might want to configure git to automatically push that branch when you use git push. By default git push will use the local master branch, but you can use the 'test' branch as the source of your changes:
     334# git config remote.origin.push test:master
     337Now git push will merge into your master branch on your personal repository. You can also setup a remote branch:
     339# git config remote.origin.push test:test
     341You can see what branch is configured for pushing with
     343# git remote show origin
     345And reset to the default
     347# git config remote.origin.push master
    254349=  Troubleshooting  =