wiki:u/erica/GitRepos

Version 13 (modified by Erica Kaminski, 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 '*') 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, 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 checkout -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.

This new branch is only a local copy, meaning 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 yet present in the central repo), and that no one else can see it. Instead, you want to push (i.e. copy) this branch into the central repo,

git push -u origin your_new_branch

Now others would see your branch if they downloaded a clean version of the repo, or updated theirs with,

git pull
git branch -a

Note, as you go on to make changes to this branch, they will be local until you commit and push those changes back into the central repo. (cf. here for details).

To keep track of your changes, you give the command,

git status

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

? What about your pushing your ticket branch back into the central repo after it has been merged? Or does command, git push, push *all* of your local repos back into the main repo?

?I think you can only push changes back into the central repo that have been 'checked in', right?

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)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.