Git tips: Difference between revisions

From OLPC
Jump to navigation Jump to search
(two more git tips)
No edit summary
Line 21: Line 21:
= When you mess up a file and want it back to what it was, cd into the directory =
= When you mess up a file and want it back to what it was, cd into the directory =


'''git checkout HEAD -- gridwidget.py'''
git checkout HEAD -- gridwidget.py


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


Read only:
'''git-clone git://dev.laptop.org/projects/tamtam'''

git-clone git://dev.laptop.org/projects/tamtam

If you have commit access:

git-clone git+ssh://dev.laptop.org/git/projects/tamtam



The general git user manual can be found here: [[http://www.kernel.org/pub/software/scm/git/docs/user-manual.html git user-manual]]
The general git user manual can be found here: [[http://www.kernel.org/pub/software/scm/git/docs/user-manual.html git user-manual]]

Revision as of 10:54, 26 February 2008

Create a remote branch

git clone git+ssh://dev.laptop.org/git/sugar
cd sugar
git branch trial-3
git push origin trial-3

Work on a remote branch

git clone git+ssh://dev.laptop.org/git/sugar
git checkout --track -b trial-3 origin/trial-3
git pull

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

Apply changes from master

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

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

git checkout HEAD -- gridwidget.py

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

Read only:

git-clone git://dev.laptop.org/projects/tamtam

If you have commit access:

git-clone git+ssh://dev.laptop.org/git/projects/tamtam


The general git user manual can be found here: [git user-manual]