A few git usage questions -


  1. say create branch, merge master, realize things went wrong. how can revert before merged?

  2. say create branch, work on it, , go merge , allot of conflicts. don't want deal , make new branch master now, how can this?

btw, what's best tutorial you've seen online real life git usage patterns?

  1. if merged , don't want commit, proper command

    git reset --hard head@{1} 

    this means reset branch before (read on {} syntax - can info reading git reflog). head^1 work have aware specifying first parent of current commit.

    careful notify if pushed commit already. don't if don't have ability communicate future forced update of branch in shared repository.

  2. the proper way merge again, time new branch , specify want side. "theirs" strategy has been deprecated.

    git merge -s ours master 

    then update master other branch is:

    git checkout master git merge --ff-only otherbranch 

    or, instead, since know going fast-forward merge (the above safety check), can update master current commit without checking out:

    git update-ref refs/heads/master head 

    and can continue on working on branch. if going work on master, use previous commands.

  3. here links found useful:

    gitready.com commuinity git book pro git book my article

    other sources:

    irc channel on freenode twitter search waterfall

    you can find me on twitter under same id.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -