User Tools

Site Tools


kurs:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
kurs:git [2012/01/04 11:19]
mh
kurs:git [2014/09/10 21:22] (current)
Line 7: Line 7:
 git checkout abcde file/​to/​restore git checkout abcde file/​to/​restore
  
-==== Alle - auch remote - branches anzeigen (geht logischerweise erst nach einem pull) =====+==== Alle - auch remote - branches anzeigen (geht logischerweise erst nach einem pull) ====
  
-git branch -a+''> ​git branch -a''​
  
 danach lokalen tracking branch erstellen danach lokalen tracking branch erstellen
  
-git checkout -b develop ​ remotes/​origin/​develop+''> ​git checkout -b develop remotes/​origin/​develop''​
  
 topic branch abzweigen (branchen) topic branch abzweigen (branchen)
  
-git branch topic +''> ​git checkout ​-b topic --track develop''​
-git checkout topic+
  
 gegebenenfalls ins repo schieben gegebenenfalls ins repo schieben
  
-git push origin topic+''> ​git push origin topic''​
  
 +Entwickeln & testen ggf mehrere commits und pushes auf das repo
  
 +wenn fertig ​
  
 +''>​ git checkout develop''​
 +
 +''>​ git merge --no-ff topic''​
 +
 +''>​ git push''​
 +
 +
 +==== Mergen ====
 +
 +Problem: wenn zwischen einem pull --rebase auf lokalem repo A "​etwas"​ widersprüchliches zu einem push von lokalem repo B passiert
 +
 +<​code>​
 +>git pull --rebase
 +remote: Counting objects: 5, done.
 +remote: Compressing objects: 100% (1/1), done.
 +remote: Total 3 (delta 1), reused 3 (delta 1)
 +Unpacking objects: 100% (3/3), done.
 +From github.com:​MarkHofstetter/​kurs-employee
 +   ​0d61041..2ae5a03 ​ Mark       -> origin/Mark
 +First, rewinding head to replay your work on top of it...
 +Applying: changed d to 300
 +Using index info to reconstruct a base tree...
 +Falling back to patching base and 3-way merge...
 +Auto-merging git_test.txt
 +CONFLICT (content): Merge conflict in git_test.txt
 +Failed to merge in the changes.
 +Patch failed at 0001 changed d to 300
 +
 +When you have resolved this problem run "git rebase --continue"​.
 +If you would prefer to skip this patch, instead run "git rebase --skip"​.
 +To restore the original branch and stop rebasing run "git rebase --abort"​.
 +</​code>​
 +
 +Manuelles reparieren der Konflikte
 +
 +>git add git_test.txt
 +
 +>git commit -m "​treffen in der Mitte d = 250"
 +[detached HEAD e1ddd18] treffen in der Mitte d = 250
 + 1 files changed, 2 insertions(+),​ 2 deletions(-)
 +
 +>git rebase --continue
 +Applying: changed d to 300
 +No changes - did you forget to use 'git add'?
 +
 +When you have resolved this problem run "git rebase --continue"​.
 +If you would prefer to skip this patch, instead run "git rebase --skip"​.
 +To restore the original branch and stop rebasing run "git rebase --abort"​.
 +
 +
 +>git rebase --skip
 +HEAD is now at e1ddd18 treffen in der Mitte d = 250
 +Nothing to do.
 +
 +>git push
 +
 +
 +
 +=== Aus einem vorhandenen repo ein remote machen ===
 +
 +[[http://​qugstart.com/​blog/​ruby-and-rails/​create-a-new-git-remote-repository-from-some-local-files-or-local-git-repository/​|remote repo anlegen]]
  
  
kurs/git.1325672378.txt.gz · Last modified: 2014/09/10 21:22 (external edit)