Skip to content

Instantly share code, notes, and snippets.

@JamesRexMiller4
Created February 6, 2020 18:56
Show Gist options
  • Save JamesRexMiller4/33635b7c412b1e556ff950779eefd20c to your computer and use it in GitHub Desktop.
Save JamesRexMiller4/33635b7c412b1e556ff950779eefd20c to your computer and use it in GitHub Desktop.

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

I think for right now the git squash and rebase sounds like something that could be beneficial in keeping the commits from bloating out of control. When working on a larger codebase, with a lot of developer working in tandem, I think git log will be helpful in allowing me to understand the changes that have occurred while working on a branch.

How does rebasing work compared to a merge workflow?

From my understanding merging would be like shuffling a deck of cards by combining them in order chronologically, where as rebase would be taking a slice of cards(commits) and putting them atop the rest of the deck(master).

Why would we ever use git stash?

Git stash is useful when you are working on changes on a feature branch and need to switch over to another branch before deciding to commit them. This helps to reduce unneccessary commits before the work is finished, helps to catch you if you accidentally work on a branch you weren't intending to, or taking changes from one branch and applying them onto another.

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

Git reset will restore a branch to its last commit. You could also indicate a specific commit that you wish to rollback/reset to.

Git reset --soft would allow you to undo your changes, but if you so desired you could restore them. Git reset --hard is permanently erasing the changes.

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