Version 6 (modified by 10 years ago) ( diff ) | ,
---|
One can check out the golden version of the code with the command,
git clone ssh://orda@botwin.pas.rochester.edu/astrobear
This puts a local copy of the last release of the code (called the 'Master' branch) in your current working directory, in a folder named astrobear. Switching into the folder astrobear, you can see the branch's name with the command,
git branch
which shows you the current branch you are on (marked by an '*', and in this example would be '*Master') 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
Once you have done this, then you want to merge it with your working branch,
git merge your_new_branch
Once this is merged, you then want to push those changes back into the repo.,
git push
*Note here, I think you can only 'copy' things back into the central repo that have been 'checked in'.
This will push whatever branch you are on back into the central repo (so for this example, that is the development branch).
Once you are done with your edits, you can delete your local copies of the repos with,
git delete
(although, why is this necessary, can't you just delete your local copies by deleting the whole directory?)
and can delete your branch in the central repo with the command,
Attachments (1)
- branch_drawing.png (54.0 KB ) - added by 10 years ago.
Download all attachments as: .zip