This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
git [2023/01/30 00:19] dblume [Limit scope of huge repos] |
git [2023/03/21 09:54] (current) dblume |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== git ====== | ====== git ====== | ||
- | Make the clone at the remote repository. | + | Make the clone of the remote repository. |
< | < | ||
Line 9: | Line 9: | ||
< | < | ||
git remote add upstream git:// | git remote add upstream git:// | ||
+ | </ | ||
+ | |||
+ | If it's a huge repo, [[https:// | ||
+ | |||
+ | < | ||
+ | git clone \ | ||
+ | --filter=blob: | ||
+ | -b main \ | ||
+ | --single-branch \ | ||
+ | --no-tags \ | ||
+ | --shallow-submodules \ | ||
+ | --recurse-submodules=os/ | ||
+ | --recurse-submodules=': | ||
+ | git@fake.github.com: | ||
</ | </ | ||
Line 54: | Line 68: | ||
$ git push --set-upstream origin new_branch | $ git push --set-upstream origin new_branch | ||
+ | ==== Creating a local branch from an existing remote ==== | ||
+ | |||
+ | After doing a fetch, and suppose " | ||
+ | |||
+ | $ git switch remote-branch | ||
==== Changing a local branch to a new remote branch ==== | ==== Changing a local branch to a new remote branch ==== | ||
Line 122: | Line 141: | ||
<code bash> | <code bash> | ||
git pull --rebase | git pull --rebase | ||
+ | </ | ||
+ | |||
+ | ====== Applying changes in a stash to a changed file ===== | ||
+ | |||
+ | When '' | ||
+ | |||
+ | < | ||
+ | git stash show -p | patch -p0 | ||
</ | </ | ||
Line 188: | Line 215: | ||
<code bash> | <code bash> | ||
git submodule update --recursive | git submodule update --recursive | ||
- | < | + | </code> |
====== git vim mergetool on macOS ====== | ====== git vim mergetool on macOS ====== |