| ... | ... | @@ -5,11 +5,11 @@ Git is a versionning tool allowing multiple programmers to work simultaneously o |
|
|
|
# commands
|
|
|
|
## add
|
|
|
|
|
|
|
|
To prepare a [[https://gitlab.eclipse.org/groups/eclipse/aidge/-/wikis/Get-good-at-git#commit|commit]] : each added file will be in your next [[#commit]]
|
|
|
|
To prepare a (commit)[Get good at git#commit] : each added file will be in your next (commit)[Get good at git#commit]
|
|
|
|
```bash
|
|
|
|
git add <file/folder>
|
|
|
|
```
|
|
|
|
To remove an added file use the [[#args|restore --staged <path>]] command .
|
|
|
|
To remove an added file use the (restore --staged <path>)[#args] command .
|
|
|
|
|
|
|
|
## bisect
|
|
|
|
allow you to research when a bug has occurred within your history : if a commit is good or bad.
|
| ... | ... | @@ -61,7 +61,7 @@ repository is either ssh or https address of the repo. |
|
|
|
## commit
|
|
|
|
A commit is like a checkpoint : you have modified multiple files, and you [[#push]] them to the [[#origin]] with a commit message like "hey I've done this and that".
|
|
|
|
|
|
|
|
A commit can but doesn't have to contain all your modified files, it will only include [[#add|added]] files.
|
|
|
|
A commit can but doesn't have to contain all your modified files, it will only include (added)[[#add|]] files.
|
|
|
|
any commit will be accompanied by a **commit message** that NEEDS to contain the important things that has been modified in the added files.
|
|
|
|
|
|
|
|
```bash
|
| ... | ... | @@ -178,7 +178,7 @@ git merge <branch_B> |
|
|
|
```
|
|
|
|
|
|
|
|
If you are on your own branch and want to merge your branch into `main`, It is strongly advised to merge main into your branch to keep track of latest updates of main and add them in your branch.
|
|
|
|
![[Pasted image 20221117133020.png|300]]
|
|
|
|
!(300)[[Pasted image 20221117133020.png|]]
|
|
|
|
|
|
|
|
---
|
|
|
|
|
| ... | ... | @@ -250,7 +250,7 @@ git restore <file/folder/path> |
|
|
|
```bash
|
|
|
|
restore --staged <path>
|
|
|
|
```
|
|
|
|
will remove given file of the list of [[#add|added]] files.
|
|
|
|
will remove given file of the list of (added)[[#add|]] files.
|
|
|
|
|
|
|
|
---
|
|
|
|
|
| ... | ... | @@ -286,7 +286,7 @@ Once you have set up your repo in local you can start modifying it. |
|
|
|
```bash
|
|
|
|
git status
|
|
|
|
```
|
|
|
|
will show you what files you have modified / [[#add|added]] and not [[#commit|commited]].
|
|
|
|
will show you what files you have modified / (added)[[#add|]] and not (commited)[[#commit|]].
|
|
|
|
|
|
|
|
### save
|
|
|
|
allows you to give a specific name to the stash you are creating :
|
| ... | ... | @@ -393,7 +393,7 @@ git -C <path_to_repo> <git_command> |
|
|
|
```
|
|
|
|
|
|
|
|
## Change the author of a commit
|
|
|
|
Use [[#rebase|git rebase]] for that
|
|
|
|
Use (git rebase)[[#rebase|]] for that
|
|
|
|
```bash
|
|
|
|
git rebase -i <hash>
|
|
|
|
```
|
| ... | ... | @@ -410,4 +410,4 @@ git rebase --continue |
|
|
|
>
|
|
|
|
|
|
|
|
# Sources
|
|
|
|
https://www.youtube.com/watch?v=ecK3EnyGD8o |
|
|
\ No newline at end of file |
|
|
|
https://www.youtube.com/watch?v=ecK3EnyGD8o |