Added stash, amend rebase and gitignore

This commit is contained in:
Hugo 2021-04-02 15:42:17 +02:00
parent 82ec9d32c1
commit 607672cd65
1 changed files with 29 additions and 1 deletions

View File

@ -211,3 +211,31 @@ temporarily stash your work since your last commit
>git stash pop
fetch your stashed work to continue it
$ git stash pop stash@{2}
in case you want to apply a specific Stash item (not the most recent one), you can provide the index name of that item in the "pop" option
### Rewriting history
>git commit --amend -m "New commit message"
replace the message of the last commit without altering the snapshot
>git commit --amend --no-edit
replace the latest commit with a commit that includes recents git add
>git rebase -i {branch}
take the precedent commit and add it to your branch
### Ignoring files
>touch .gitignore && echo {what you want to ignore} >> .gitignore
create a file and specify what (extensions, directories, files) to ignore in it
>git rm --cached {fileignored}
remove from the tracking index a file that should be ignored but wasnt because already tracked when the ignore rule was created