Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tools:git [2023/10/21 11:14] – datalad, dvd will | tools:git [2026/06/17 14:17] (current) – [Git] will | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Alternative SCM tools include '' | Alternative SCM tools include '' | ||
| - | '' | + | '' |
| + | |||
| + | See [[: | ||
| For more see | For more see | ||
| * https:// | * https:// | ||
| + | * http:// | ||
| * https:// | * https:// | ||
| - | ===== Using ===== | + | ===== Track Changes |
| - | On the command line in terminal/ | + | |
| + | {{: | ||
| + | |||
| + | On the command line in terminal/ | ||
| + | Need a mnemonic? Think of the '' | ||
| < | < | ||
| git add $file # move changes in $file to " | git add $file # move changes in $file to " | ||
| Line 18: | Line 26: | ||
| git push # send changes to a server (e.g. github) | git push # send changes to a server (e.g. github) | ||
| </ | </ | ||
| + | |||
| + | <WRAP alert round> | ||
| + | | ||
| + | |||
| + | Only the '' | ||
| + | |||
| + | '' | ||
| + | </ | ||
| By default, '' | By default, '' | ||
| Line 26: | Line 42: | ||
| - '': | - '': | ||
| + | ==== Commit messages ==== | ||
| + | |||
| + | Each commit in git includes a human-annotated short description in prose. While it's tempting and easy use `" | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | === Examples === | ||
| + | Two commit messages in '' | ||
| + | < | ||
| + | feat: age model with GAM instead of LM | ||
| + | fix: outlier detection applied to all EEG columns | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | ✨️ model.py: age GAM instead of LM | ||
| + | 🐛 plot.R: apply outlier detection ∀ EEG cols | ||
| + | </ | ||
| + | |||
| + | ===== See Changes ===== | ||
| + | |||
| + | A huge benefit of version control is to see the what's changed. This can be done with web, graphical, and command line interfaces. | ||
| + | |||
| + | |||
| + | The command line/ | ||
| + | < | ||
| + | git log # history of all changes | ||
| + | git status | ||
| + | git diff # what's changed in tracked files | ||
| + | git blame $file # show what commit/ | ||
| + | </ | ||
| + | |||
| + | If the output is more than a screenful, these commands will launched put the output in the pager '' | ||
| + | * arrow keys navigate | ||
| + | * push ''/'' | ||
| + | * push '' | ||
| - | ==== Github https push ==== | + | ===== Advanced ===== |
| - | To push to '' | + | |
| - | + | | |
| - | ==== ssh push ==== | + | * rebase, esp with [[https://magit.vc/manual/ |
| - | '' | + | * [[https:// |
| + | * [[https://jvns.ca/blog/2024/02/ | ||
| + | | ||