Git

Published on 2017-07-25T20:19:15-04:00 by Mohd

Ignore swp/swo/bak/orig files from git forever!

Create a .gitignore file with the files you want to ignore.

*.swp
*.swo
*.bak
*.orig

Then execute

git config --global core.excludesfile C:\.gitignore

Assuming that the .gitignore file you created resides in C:. That's it!

Apply changes to another branch without committing

This is useful when you need to apply changes to work on something but must undo those changes before comitting the real changes ._.

git merge --no-commit --squash branchA
git reset HEAD # to unstage the changes