git
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| git [2024-03-23] – hanez | git [2025-07-13] (current) – ↷ Links adapted because of a move operation 217.113.194.145 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Git ====== | ====== Git ====== | ||
| + | |||
| + | ===== Add tag ===== | ||
| + | |||
| + | <code shell> | ||
| + | |||
| + | ==== Commit a tag ==== | ||
| + | |||
| + | < | ||
| + | |||
| + | ==== Commit all tags ==== | ||
| + | |||
| + | < | ||
| + | |||
| + | Source: [[https:// | ||
| + | |||
| + | ===== Checkout a specific tag ===== | ||
| + | |||
| + | <code bash>git checkout TAG</ | ||
| + | |||
| + | More: [[https:// | ||
| ===== Clone a specific tag ===== | ===== Clone a specific tag ===== | ||
| Line 5: | Line 25: | ||
| <code bash>git clone --depth 1 --branch < | <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 25: | 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 33: | 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 ===== | ===== How to undo local changes to a specific file ===== | ||
| Line 54: | Line 84: | ||
| + | ===== 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.1711169966.txt.gz · Last modified: by hanez
