Git: continue repository history from previous commit -


let's master branch of repository looks this:

* commit 75e259944814a102d6362eaf42fd4ff09d839865 | |       bad commit | * commit 0307a5c4e623c584898c44d243a50bb02c91aa9e | |       commit 1. | * commit 98ef0e69e3e5cd51ff5e24c1df616703272c5a79 | |       commit 1. | 

the bad commit has been pushed central repository , distributed. want continue history last commit. when done, history like

* commit 0626f793ff7ba847e7663fe88de6c6a2d597dc73 |  |       continuing development. |  | * commit 75e259944814a102d6362eaf42fd4ff09d839865 | |  | |     bad commit | | | |      | | * | commit 0307a5c4e623c584898c44d243a50bb02c91aa9e |/  |       commit 2. | |        | * commit 98ef0e69e3e5cd51ff5e24c1df616703272c5a79 | |       commit 1. | 

that is, development continues last "good" commit. can safely achieve though "bad" commit has been distributed among developers?

if reset current branch last commit git reset --hard , make new commits , push again, you'll changing history out under coworkers who've started working on top of bad commit. small, local team know they're doing in git, may not big deal. can warn front, make change , push it, tell them adjust locally. can bit of pain if people have made feature branches , merges after bad commit, though. they'll end having reset things around, remake merges, etc.

you start new branch @ last commit, won't remove bad commit history of current branch, it's not helpful.

what want in situations git revert bad commit, makes new commit reverse of bad commit. won't change anyone's history. it'll add new commit fixes issue. have @ git revert details. it's simple.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -