MarkLodato / visual-git-guide

A visual guide to git.
http://marklodato.github.io/visual-git-guide/
1.32k stars 308 forks source link

using git reset --hard origin/feature_branch #20

Open pdurbin opened 11 years ago

pdurbin commented 11 years ago

At http://irclog.greptilian.com/sourcefu/2013-03-15 @ironcamel mentioned asking a collaborator use

git reset --hard origin/feature_branch

to make their local copy of a feature branch match what some has pushed with --force (after a rebase).

I was wondering if you would consider including this scenario at http://marklodato.github.com/visual-git-guide/index-en.html#reset

MarkLodato commented 11 years ago

I do explain --hard but fail to give any examples of why one would want to use it. I think this can be made into a more general request to give such examples for most cases. For example, I should also explain when git reset -p / git reset -- files should be used.

pdurbin commented 11 years ago

Right, you do say "if --hard is given, the working directory is also updated" but I love real world examples. I'm still not sure how common...

git reset --hard origin/feature_branch

... is but @ironcamel calls it a "pretty standard workflow" (in combination with git rebase) so maybe it would be a decent use case for your guide. Thanks for considering it! :)