diff --git a/readme.md b/readme.md index 443a726..9bac85c 100644 --- a/readme.md +++ b/readme.md @@ -210,4 +210,32 @@ temporarily stash your work since your last commit >git stash pop -fetch your stashed work to continue it \ No newline at end of file +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