Skip to content

Instantly share code, notes, and snippets.

@mcat56
Created February 6, 2020 18:51
Show Gist options
  • Save mcat56/7ec05db440b879dc548be90f334b2796 to your computer and use it in GitHub Desktop.
Save mcat56/7ec05db440b879dc548be90f334b2796 to your computer and use it in GitHub Desktop.

1. What is one command that you'll incorporate into your daily workflow and why?

git reset --soft HEAD^ I will use this command to "undo" a commit but still be able to see the changes

2. How does rebasing work compared to a merge workflow?

Rebasing stacks your new branch changes on top of the master you are basing off of, it rewrites the SHA history, and pulls in all commits so they are all on your current branch

3. Why would we ever use git stash?

Git stash is useful to remove changes to files but still be able to access them and apply them in other places if needed. You can also stash changes and never use them again if they were unwanted.

4. What is the primary difference between git reset —soft and git reset —hard?

The primary difference is -soft will keep those changes to your files so you could add them again and commit them, -hard removes the changes completely so you won't have access to them any longer once they are removed

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