(@ wanted branch)
$ git format-patch -o patched/ -1
- how many commit?
1
$ git log --format=oneline --decorate=short -10 patches/git.log
- how many commit?
10
(more than patches.)
Send email to peer with these:
- Commit or Feature Name:
- Summary of commits:
- Which branch are you working on? eg.
master
- Add attachments:
patches/*.patch
- Add attachments:
patches/git.log
(You can also verify your patch before sending it! - GOTO: V.)
(@ wanted branch)
$ git am patches/
- When failed: $
git am --abort
and Check and compare:
$ git log
If COMMIT was differ:
- $
git reset --hard origin/master
- $
cp .hooks/post-applypatch .git/hooks/post-applypatch
(link) - Retry.
- Failed? Ask to send bundle file! (- GOTO: B.)
Create baseline for peer:
- $
cd ..
- $
git clone {GIT_URL} {PROJECT_NAME}.for_peer
Match git log history with peer:
(@ wanted branch)
- $
git reset --hard HEAD^1
- $
git log
and compare it. (until matched, anyway.)
Verify git am
- $
git am patches/
- $
git log
If error occured, check the error message or check below section for limitations (GOTO: X.)
git format-patch
doesn't cover:
- Merged commits
git pull
git merge --no-ff
- Empty commits
git commit --allow-empty
- Changed commits
git commit --amend
(author time differ with committer time)
git am
eats:
- Commit message starts with
[]
bracket. (eg.[ACTION REQUIRED]
)
When we met limitations: Bundle it!
- $
cd ..
- $
git clone {GIT_URL} {PROJECT_NAME}.for_peer
(Match git log history with peer:)
- $
cd {PROJECT_NAME}.for_peer
- $
git checkout master
(or wanted branch.) - $
git reset --hard HEAD^1
(until matched, anyway.)
(but add this to original workspace as new remote.)
- $
cd ..\{PROEJECT_NAME}
- $
git remote add for_peer ..\{PROJECT_NAME}.for_peer
(replace master to wanted branch.)
-
$
git fetch for_peer master
-
$
git fetch origin master
-
$
git bundle create master.bundle for_peer/master..origin/master
- or $
git bundle create master.bundle origin/master..master
- or $
-
$
git bundle verify master.bundle
-
$
git log --format=oneline --decorate=short -10 > master.log
(replace master to wanted branch.)
- $
cd ..\{PROJECT_NAME}.for_peer
- $
git bundle verify master.bundle
- $
git fetch master.bundle master:unbundled
- $
git log unbundled
- $
git branch -d unbundled
(replace master to wanted branch.)
- $
git bundle verify master.bundle
- $
git fetch master.bundle master:unbundled
- $
git checkout unbundle
- $
git log
compare - $
git checkout master
- $
git merge unbundled
- $
git log
compare - $
git branch -d unbundle