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


Ignore:
Timestamp:
11/20/13 03:08:31 (10 years ago)
Author:
Gedare
Comment:

/* Manage Your Code */ New subsection

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Git/Users

    v9 v10  
    320320
    321321This access through http is slower (way slower!) than through the git protocol therefore the git protocol is preferred. 
     322=  Manage Your Code  =
     323
     324
     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 [https://github.com GitHub] or [https://bitbucket.org/ 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 [http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server 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  =
     327
     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.
     329
     330To push a mirror to your private server, first create a bare repository on your server.
     331{{{
     332cd /home/@USER@
     333mkdir git
     334mkdir git/@REPO@.git
     335cd git/@REPO@.git
     336git --bare init
     337}}}
     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:
     339{{{
     340git remote add @SERVER@ ssh://@SERVER@/home/@USER@/git/@REPO@.git
     341git push @SERVER@ master
     342}}}
     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.
     344
     345The following is an example scenario that might be useful for RTEMS users that uses a slightly different approach than the one just outlined:
     346{{{
     347ssh @SERVER@
     348mkdir git
     349git clone --mirror git://git.rtems.org/rtems.git
     350## Add your ssh key to ~/.ssh/authorized_keys
     351exit
     352git clone ssh://@SERVER@/home/@USER@/git/rtems.git
     353cd rtems
     354git remote add upstream git://git.rtems.org/rtems.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
     367
     368## delete a remote branch
     369git push origin :anewbranch
     370## delete a local branch
     371git branch -d anewbranch
     372}}}
     373
     374
    322375=  Learn more about Git  =
    323376