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/10 11:10]
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''​
Line 34: Line 34:
  
  
 +==== 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.1326190216.txt.gz · Last modified: 2014/09/10 21:22 (external edit)