Changes between Version 9 and Version 10 of Developer/Git/Users

Nov 20, 2013, 3:08:31 AM (6 years ago)

/* Manage Your Code */ New subsection


  • Developer/Git/Users

    v9 v10  
    321321This access through http is slower (way slower!) than through the git protocol therefore the git protocol is preferred. 
     322=  Manage Your Code  =
     325You may prefer to keep your application and development work in a git repository for all the good reasons that come with version control. For public repositories, you may like to try [ GitHub] or [ BitBucket]. RTEMS maintains mirrors on GitHub, which can make synchronizing with upstream changes relatively simple. If you need to keep your work private, you can use one of those services with private repositories or manage your own server. The details of setting up a server are outside the scope of this document, but if you have a server with ssh access you should be able to [ find instructions] on how to set up git access. Once you have git configured on the server, adding repositories is a snap.
     326=  Private Servers  =
     328In the following, replace @USER@ with your username on your server, @REPO@ with the name of your repository, and @SERVER@ with your server's name or address.
     330To push a mirror to your private server, first create a bare repository on your server.
     332cd /home/@USER@
     333mkdir git
     334mkdir git/@REPO@.git
     335cd git/@REPO@.git
     336git --bare init
     338Now from your client machine (e.g. your work laptop/desktop), push a git, perhaps one you cloned from elsewhere, or one that you made locally with 'git init', by adding a remote and pushing:
     340git remote add @SERVER@ ssh://@SERVER@/home/@USER@/git/@REPO@.git
     341git push @SERVER@ master
     343You can replace the @SERVER@ with another name for your remote if you like. And now you can push other branches that you might have created. Now you can push and pull between your client and your server.
     345The following is an example scenario that might be useful for RTEMS users that uses a slightly different approach than the one just outlined:
     347ssh @SERVER@
     348mkdir git
     349git clone --mirror git://
     350## Add your ssh key to ~/.ssh/authorized_keys
     352git clone ssh://@SERVER@/home/@USER@/git/rtems.git
     353cd rtems
     354git remote add upstream git://
     355git fetch upstream
     356git pull upstream master
     357git push
     358## If you want to track RTEMS on your personal master branch,
     359## you should only push changes to origin/master that you pull
     360## from upstream. The basic workflow should look something like:
     361git checkout master
     362git pull upstream master
     363git push
     364git checkout -b anewbranch
     365## Repeat: do work, git commit -a
     366git push origin anewbranch
     368## delete a remote branch
     369git push origin :anewbranch
     370## delete a local branch
     371git branch -d anewbranch
    322375=  Learn more about Git  =