git
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| git [2022-09-04] – hanez | git [2025-07-13] (current) – ↷ Links adapted because of a move operation 217.113.194.145 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Git Notes ====== | + | ====== Git ====== |
| - | ===== Clone a specific | + | ===== Add tag ===== |
| + | <code shell> | ||
| - | 683 | + | ==== Commit a tag ==== |
| - | git clone --depth 1 --branch | + | <code>git push origin TAG</code> |
| + | ==== Commit all tags ==== | ||
| + | |||
| + | < | ||
| + | |||
| + | Source: [[https:// | ||
| + | |||
| + | ===== Checkout a specific tag ===== | ||
| + | |||
| + | <code bash>git checkout TAG</ | ||
| + | |||
| + | More: [[https:// | ||
| + | |||
| + | ===== Clone a specific tag ===== | ||
| + | |||
| + | <code bash>git clone --depth 1 --branch < | ||
| + | |||
| + | More: [[https:// | ||
| ===== Specify the private SSH-key to use when executing a Git command: ===== | ===== Specify the private SSH-key to use when executing a Git command: ===== | ||
| Line 15: | Line 33: | ||
| Example: | Example: | ||
| - | | + | <code bash>ssh-agent bash -c ' |
| Source: [[https:// | Source: [[https:// | ||
| Line 28: | Line 46: | ||
| 3. git rm -f a/submodule # Note: a/submodule (no trailing slash) | 3. git rm -f a/submodule # Note: a/submodule (no trailing slash) | ||
| - | + | ==== or, if you want to leave it in your working tree and have done step 0 ==== | |
| - | # or, if you want to leave it in your working tree and have done step 0 | + | |
| 3. git rm --cached a/submodule | 3. git rm --cached a/submodule | ||
| Line 36: | Line 53: | ||
| Source: [[https:// | Source: [[https:// | ||
| + | |||
| + | ===== git undo all uncommitted or unsaved changes ===== | ||
| + | |||
| + | < | ||
| + | |||
| + | Or: | ||
| + | |||
| + | < | ||
| + | |||
| + | Source: [[https:// | ||
| + | |||
| + | ===== How to undo local changes to a specific file ===== | ||
| + | |||
| + | < | ||
| + | |||
| + | Source: [[https:// | ||
| + | |||
| + | ===== Undo all uncommitted or unsaved changes ===== | ||
| + | |||
| + | Source: [[https:// | ||
| + | |||
| + | ===== Getting the difference between two repositories ===== | ||
| + | |||
| + | < | ||
| + | git remote update | ||
| + | git diff master remotes/ | ||
| + | git remote rm b</ | ||
| + | |||
| + | Source: [[https:// | ||
| + | |||
| + | |||
| + | ===== How do I " | ||
| + | |||
| + | So, first commit/push your submodule' | ||
| + | |||
| + | < | ||
| + | git add < | ||
| + | git commit -m " | ||
| + | git push</ | ||
| + | |||
| + | Then, update your main project to track the updated version of the submodule: | ||
| + | |||
| + | < | ||
| + | git add path/ | ||
| + | git commit -m " | ||
| + | git push</ | ||
| + | |||
| + | Source: [[https:// | ||
| + | |||
| + | ===== Remove sensitive files and their commits from Git history ===== | ||
| + | |||
| + | < | ||
| + | git push --force --verbose --dry-run | ||
| + | git push --force</ | ||
| + | |||
| + | |||
| + | Source: [[https:// | ||
| + | |||
| + | ===== How to merge two or multiple git repositories into one ===== | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
git.1662310645.txt.gz · Last modified: by hanez
