|
|
|
Git is a versionning tool allowing multiple programmers to work simultaneously on the same codebase.
|
|
|
|
Remember one day as a programmer you will have issues with git, wether you want it or not. So you better get good at it.
|
|
|
|
|
|
|
|
Once you have learnt how these commands work I strongly advise you to use a git tui (Terminal user Interface) such as [gitui](https://github.com/extrawurst/gitui) to help you with your productivity.
|
|
|
|
Once you have learnt how these commands work I strongly advise you to use a git tui (Terminal user Interface) such as [gitui](https://github.com/extrawurst/gitui) or vscode.
|
|
|
|
This will help you curate your commits to have meaningful commits.
|
|
|
|
|
|
|
|
[TOC]
|
|
|
|
|
| ... | ... | @@ -392,10 +393,11 @@ git -C <path_to_repo> <git_command> |
|
|
|
```
|
|
|
|
|
|
|
|
## Change the author of a commit
|
|
|
|
Use [git rebase](#rebase) for that
|
|
|
|
Use [git rebase](#rebase) if you need to apply that to multiple commits.
|
|
|
|
```bash
|
|
|
|
git rebase -i <hash>
|
|
|
|
```
|
|
|
|
This will open your default text editor (defined with the environment variable $EDITOR).
|
|
|
|
Then put `edit` in front of the commit you want to modify.
|
|
|
|
```bash
|
|
|
|
edit <hash>
|
| ... | ... | |