Git tips

Jump to: navigation, search

Working on branches

Create a remote branch

git clone git+ssh://
cd sugar
git branch update-1
git push origin update-1

Work on a remote branch

git clone git+ssh://
git checkout --track -b update-1 origin/update-1
git pull

You can now use commit, push and pull as usual.

Apply changes from master

git-cherry-pick <commit-id>
git push

Reverting changes

When you mess up a file and want it back to what it was, cd into the directory and:

git checkout HEAD --

To remove uncommitted changes and reset the project to HEAD:

get reset --hard HEAD

When you want an activity that sugar-jhbuild does not bring down

Read only:

git-clone git://

If you have commit access:

git-clone git+ssh://

See also