general:git
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
general:git [2021/12/20 09:11] – sunkan | general:git [2021/12/20 09:23] – sunkan | ||
---|---|---|---|
Line 30: | Line 30: | ||
< | < | ||
$ cat ~/ | $ cat ~/ | ||
+ | </ | ||
+ | |||
+ | Script to automate fetching and re-applying patches | ||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | |||
+ | localbranch=mybranch-1.x | ||
+ | remotebranch=1.x | ||
+ | patchdir=~/ | ||
+ | repodir=~/ | ||
+ | |||
+ | # Generate patches | ||
+ | # git format-patch -k -o " | ||
+ | |||
+ | ( cd $repodir | ||
+ | # Apply patches | ||
+ | git checkout master # Needs to be run before fetch | ||
+ | git branch -D $localbranch-old | ||
+ | git branch -m $localbranch $localbranch-old | ||
+ | git fetch | ||
+ | git checkout -b $localbranch origin/ | ||
+ | cat " | ||
+ | ) | ||
</ | </ | ||
general/git.txt · Last modified: 2023/01/30 08:53 by sunkan