Learning Git Commands
This repository is for me personal use.. to learn git commands
- Reset Head (--soft: commit cancelled, code back to staging area,
-
--mixed(default): commit cancelled, code back to woeking area
-
--hard: commit cancelled, code lost from both staging and working areas
-
)
- Revert Head: changes in the past commit is deleted and a new commit is created which is ahead of the last commit. (helpful for pushing code as the commits aren't missed)
- Rebase: (git rebase -i HEAD~3) use rebase to squash commits into one sensible commit per feature. helps reduce the number of redundant commits.
- other use case of rebase: https://www.youtube.com/watch?v=f1wnYdLEpgI get featuer branch commits aligned on the master branch