abandoned bytes
Engineering: the art of making what you want from things you can get.

GIT

30. August 2009

Verzeihung

Diese Seite ist nicht auf Deutsch verfügbar.

Visualize:

~/project.git $ gitk --all

New repo:

~ $ mkdir project.git ~ $ cd project.git ~/project.git $ git init

Clone:

~ $ git clone git://gitorious.org/project/project.git ~ $ cd project ~/project $ git remote rm origin ~/project $ git remote add origin git@gitorious.org:project/project.git # ??? are these 2 needed?? ~/project $ git pull git://gitorious.org/project/project.git master # get it up2date

Push:

~/project.git $ git add newfile ~/project.git $ git commit -m "commit message" # git commit -a -m "commit message", if you made a change to a file ~/project.git $ git push origin master

Merge together with another branch:

~/project.git $ git checkout master # if you don't want it directly, create a branch and change to it before pulling ~/project.git $ git pull git://gitorious.org/~user/project/users-clone.git

General branching:

~/project.git $ git branch # local branches ~/project.git $ git branch -r # remote branches ~/project.git $ git branch -a # all branches

Create new local branch and work:

~/project.git $ git branch * master ~/project.git $ git branch new-branch ~/project.git $ git checkout new-branch ~/project.git $ ... ~/project.git $ git commit -a -m "commit message" ~/project.git $ git push # assuming we are done with the branch, and we want it in ~/project.git $ git checkout master ~/project.git $ git rebase new-branch ~/project.git $ git branch -d davids-first ~/project.git $ git push # assuming we don't want it anymore ~/project.git $ git checkout master ~/project.git $ git branch -D davids-first

Rebase:

~/project.git $ git branch master * new-branch ~/project.git $ git rebase master # advances new-branch to master ~/project.git $ git push

Remote branching:

~/project.git $ git push origin origin:refs/heads/new-branch # create new remote branch ~/project.git $ git checkout --track -b new-branch origin/new-branch # it isn't mandatory to call the ~/project.git $ ... # local branch the same, but why not? ~/project.git $ git push origin :heads/new-branch # we want to get rid of the crap we did (or we rebased master) ~/project.git $ git checkout master ~/project.git $ git branch -D new-branch
Zuletzt geändert: 30. August 2009

Kommentare

Noch keine Kommentare. Warum schreibst Du nicht den ersten?

Kommentar schreiben

Die Felder E-Mail und Website sind optional. Die E-Mail-Adresse wird nicht angezeigt, sondern dient mir nur als Antwortmöglichkeit.

Name:
E-Mail:
Website:

Bitte CAPTCHA ausfüllen, um zu bestätigen, dass Du ein Mensch bist:

© 2009 by David Madl. Impressum | Home (English) | Home (Deutsch) | Processing time: 0.400 s | IPv4

abandoned bytes (de) > Software > Linux-Sachen > Git-Befehle
User:
Pass: