Skip to content

Instantly share code, notes, and snippets.

@trishalanglois
Created February 6, 2020 18:52
Show Gist options
  • Save trishalanglois/e7d12d8b73a7388dbf7a47c9a6beab74 to your computer and use it in GitHub Desktop.
Save trishalanglois/e7d12d8b73a7388dbf7a47c9a6beab74 to your computer and use it in GitHub Desktop.

What is one command that you'll incorporate into your daily workflow and why? I never knew about git reset! This is super helpful, especially when I've added things to staging that I didn't mean to.

How does rebasing work compared to a merge workflow? Git rebase allows us to "rewrite" our commit history, meaning that we have control over the individual commits that we've made and can modify them, as well as keeping those commits grouped together and separate from the commits from a master branch. It also does not create a commit that shows the merge between the master and feature branch happening.

Why would we ever use git stash? There are times where I'm switching from one branch to another, but I'm unable to because I have unsaved/commited changes. I use git stash often in these situations, then use git stash pop to bring them back in on the branch that I want them to live.

What is the primary difference between git reset —soft and git reset —hard? git reset HARD resets everything back to the last commit, including the working directory (any changes you've made). A soft reset, just removes the changes/file from staging, but other changes will remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment