:
2 , Github.
Git. git commit, ( ). git fetch Git (, GitHub), . . . , .
, - git merge git rebase, - - (, git pull) git merge git rebase , :
... push, [ Unmerged paths]
, . --rebase , , , .
:
git merge, git rebase? , deleted by us , , .
, , , ?
"/" , - , , , . - , - , . .
, git rebase, , git pull ( git fetch, git merge, git rebase , git pull).
, , - . , , , , , , . , master:
H
/
...
H I - . , , , Git , , - Git, commit G:
H
/
...
git fetch. Git, . J K :
H
/
...
"" (commit H) "" (commit I). : git merge git rebase. merge , , , Git .
Git . , master "" origin/master. , ( ) -- , . G.
Git:
git diff G I # figure out what "we" did on master
git diff G K # figure out what "they" did on origin/master
Git . , "" README, "" . , . : , README commit G. , Git , .
, Git README. master :
H
/ /
...
, "" ( H--I) "" ( J--K), README, somefile.ext somefile.ext. /: Git , G G. Git , L , , somefile.ext " ".
, Git :
deleted by them: somefile.ext
, "" H--I. Commits J--K , ( , - ).
Git somefile.ext , . git add git rm , . git commit, , , /. commit L, ( ) .
Rebase ,
, git rebase.
Git - , , , ( H--I), , , Git . (Git , .)
Git :
git checkout <hash-of-K>
:
git cherry-pick <hash-of-H>
, H README. commit K, "" . commit H . Git: H , , H. Git , , . Git H, H', :
H--I [somewhat in limbo]
/
...--F--G--J--K <-- origin/master
\
H' <-- HEAD
Git cherry-pick I. , somefile.ext. commit H', commit K, somefile.ext. ! , Git .
somefile.ext? commit I, ( "" ) , . somefile.ext? , , K ( J K), Git, . somefile.ext. , Git :
deleted by us: somefile.ext
, Git . Git , somefile.ext, . , J--K H--I. git add git rm , , git cherry-pick . , git commit, git rebase --continue.
Git rebase, I' , I. : , , I, somefile.ext, somefile.ext, commit . git rebase --continue , , , git rebase --skip commit I.
, (--continue I I' skip I), :
H
/
...
\
H'
I'.
git push , , .