Git tips: Difference between revisions

From OLPC
Jump to navigation Jump to search
(New page: = Create a branch = git branch trial-2 git push origin trial-2)
 
No edit summary
Line 1: Line 1:
= Create a branch =
= Create a remote branch =


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

= Work on a remote branch =

git clone git+ssh://dev.laptop.org/git/sugar
git checkout -b trial-2

Add the following to .git/config

[branch "trial-2"]
remote = origin
merge = refs/heads/trial-2

Then checkout as a local branch:

git checkout -b trial-2

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

Revision as of 12:26, 26 July 2007

Create a remote branch

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

Work on a remote branch

git clone git+ssh://dev.laptop.org/git/sugar
git checkout -b trial-2

Add the following to .git/config

[branch "trial-2"]
    remote = origin
    merge = refs/heads/trial-2

Then checkout as a local branch:

git checkout -b trial-2

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