general:git
This is an old revision of the document!
To see how branches relate
$ git log --oneline --decorate --graph --all * c2b9e (HEAD, master) made other changes | * 87ab2 (testing) made a change |/ * f30ab add feature #32 - ability to add new formats to the * 34ac2 fixed bug #1328 - stack overflow under certain conditions * 98ca9 initial commit of my project
Or use “gitk –all”
Generate patch and apply to branch with different commit history
Generate patches for local commits from origin/1.x
$ git format-patch -k -o ~/patches_dir/ origin/1.x
Update local branch when we know there is going to be a forced update
$git checkout master # Needs to be performed before doing fetch $git fetch $git branch -D 1.x $git checkout -b mybranch-1.x origin/1.x
Apply patches to branch
$ cat ~/patches_dir/* | git am -k
general/git.1639991499.txt.gz · Last modified: 2021/12/20 09:11 by sunkan