Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Git Cheat Sheet
- ===============
- Getting a remote branch without merging
- ---------------------------------------
- git fetch origin my-branch
- Aliasing Commands
- -----------------
- Tired of typing out git command? Add an alias to make things easier.
- git config --global alias.co checkout
- This is one I normally use. I alias 'co' to checkout, so to checkout a branch I use:
- git co my-feature
- Rebasing
- --------
- If multiple branches are being worked on in parallel it is necessary to keep git commit history up to date
- If you are working on branch my-feature and changes were made to master you can update your commit history with `git rebase`
- git checkout my-feature
- git rebase master
- When doing a rebase you can specify interactive mode to modify commit history.
- git rebase -i master
- Another way to squash commits
- -----------------------------
- A really simple way to squash commits is to do a soft reset of your local branch with respect to another branch.
- git checkout my-feature
- git reset --soft master
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement