Skip to content

git tips and tricks

amaurymedeiros edited this page Feb 24, 2012 · 10 revisions

To decide which code to pull, look at our Stream Strategy

There is a very useful guide for git available. There are some commonly used commands below.

To pull the latest code to a directory called myFreeseer

git clone http://github.com/Freeseer/freeseer.git myFreeseer

Note: this pulls code from the master branch.

To switch to the code in the development branch

git checkout -b development origin/development

Note: this provides you with a work area based on the development branch

To add a file
1) copy the file into your work area
2) git add filename
3) git commit -m “Added filename”

Note: this assumes you only wanted to add the file. If you had more work to do as part of that task, simply complete it before step 3.

Workflows

Creating a new branch off of development

git branch new_branch_name development

Updating your branch to include changes in upstream/development

git status
git checkout development
git clean -fd
git fetch upstream
git merge upstream/development
git checkout mybranch
git status
git rebase development

Clone this wiki locally