git
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
git [2023/03/21 09:54] – dblume | git [2024/06/12 11:29] (current) – dblume | ||
---|---|---|---|
Line 24: | Line 24: | ||
git@fake.github.com: | git@fake.github.com: | ||
</ | </ | ||
+ | |||
+ | Eventually, if you want to add another branch to a single-branch clone: | ||
+ | |||
+ | git remote set-branches --add origin another-branch | ||
+ | |||
+ | Or to de-single-branch-ize a clone: | ||
+ | |||
+ | git remote set-branches origin " | ||
+ | |||
===== Creating a new remote repository from an existing local one ===== | ===== Creating a new remote repository from an existing local one ===== | ||
Line 115: | Line 124: | ||
git switch main | git switch main | ||
git branch -d bugfix/ | git branch -d bugfix/ | ||
+ | git pull | ||
+ | </ | ||
+ | |||
+ | ====== Resolving a Merge Conflict ====== | ||
+ | |||
+ | < | ||
+ | git mergetool (possibly with filename) | ||
+ | |||
+ | # +----------+-----------+------------------+ | ||
+ | # | (others) | (common) | ||
+ | # | LOCAL | BASE | REMOTE | ||
+ | # +-----------------------------------------+ | ||
+ | # | | | ||
+ | # | temp file with <<< | ||
+ | # +-----------------------------------------+ | ||
+ | |||
+ | git commit -a -m " | ||
+ | </ | ||
+ | |||
+ | Possibly keep rebasing. | ||
+ | < | ||
+ | git rebase --continue | ||
git pull | git pull | ||
</ | </ | ||
Line 193: | Line 224: | ||
</ | </ | ||
- | I could' | + | Options are: |
+ | |||
+ | * I chose GitHub-like [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
====== Limit scope of huge repos ====== | ====== Limit scope of huge repos ====== | ||
Line 213: | Line 250: | ||
The submodule one is an optimization for the more general: | The submodule one is an optimization for the more general: | ||
+ | <code bash> | ||
+ | git submodule update --recursive | ||
+ | </ | ||
+ | |||
+ | ====== Submodules ====== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | Cloning a repo doesn' | ||
+ | |||
+ | <code bash> | ||
+ | git submodule update --init --recursive | ||
+ | </ | ||
+ | |||
+ | Git pull and checkout don't update submodules. To actually update them, you have to run the following every time you switch branches or pull. | ||
+ | |||
<code bash> | <code bash> | ||
git submodule update --recursive | git submodule update --recursive |
git.1679417641.txt.gz · Last modified: 2023/04/12 20:44 (external edit)