p:: CLI

gitignore.io - Create Useful .gitignore Files For Your Project

git pushall

Push to all remotes

git config --global alias.pushall '!git remote | xargs -L1 git push --all'

How to Squash Commits in Git

How to Squash Commits in Git | Learn Version Control with Git

To “squash” in Git means to combine multiple commits into one. You can do this at any point in time (by using Git’s “Interactive Rebase” feature), though it is most often done when merging branches.

git rebase -i HEAD~3

If you mark one or more lines as “squash”, they will be combined with the one above.

After entering a commit message for the new, combining commit, the Interactive Rebase is completed - and the three old commits have been squashed into one.

Undo last commit

git reset HEAD~

To get the latest commit of your repository

git log -1 --pretty=%H

Applying .gitignore to committed files

git - Applying .gitignore to committed files - Stack Overflow

  1. Edit .gitignore to match the file you want to ignore
  2. git rm --cached /path/to/file