wiki:u/erica/GitRepos

Version 2 (modified by Erica Kaminski, 10 years ago) ( diff )

One can check out a git repo with the command,

git clone ssh://orda@botwin.pas.rochester.edu/astrobear

This puts a local copy of the last release of the code in your current working directory, in a folder named astrobear. This 'local copy' of the last golden release of the code is a copy of the 'master' repo. You can see that with the command,

git branch

which shows you the current branch you are on out of the list of local branches you have checked out. If you just cloned the repo, the only branch in this list is the master. But you can see all the branches of the larger repo of the code and all of her branches, by giving the command,

git branch -a

Now, to do development, one switches to the development branch of the code, which is the 'living' part of the code (i.e. that which is being developed, tested, and updated) that exists between golden releases of the code.

You switch to different branches (to the development branch in this example) with the command,

git checkout development

Giving

git branch

Now shows you have 2 local checked out versions of the code, master and development, and that you are currently sitting in the development branch (marked by an '*').

From there, if you want to begin making changes to the code, you must create a new branch off of the development branch, for which you will later merge with the development branch after you have tested your edits.

git branch -b your_new_branch

This will take the current version of the development code and create an offshoot of it (i.e. a copy of it) for you to then work with.

As you make changes to this branch, note they will all be local to your working directory until you push those changes into the central repo. This means that if you were to delete your directory, your branch (and all of its changes) would cease to exist (i.e. no copy of it is present in the central repo until you push).

When you are ready to push these changes to the repo, you would give the command,

git push 

This pushes (i.e. copies) your current working branch into the central repo. So if you are working on *your_new_branch, then it will push a copy of your_new_branch into the repo.

Now, the procedure for pushing changes into the development branch goes as follows. Once your changes are ready to go into the dev branch, you want to switch back to the development branch and update it so that your changes are going to be merged with the newest version of the dev branch. You do this with,

git checkout development
git pull

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.