More for my own reference than anything else…
I have an SVN repository cloned locally. I’ve made a couple of changes in order for my application to run locally and I committed those all against the “dev” branch I set up.
I then go off and do some actual work, which then needs to get sent back upstream to SVN. This is my workflow.
Starting in the dev branch, with all of my changes committed…
-
Because I should be making sure I have the newest stuff from SVN, just in case
-
Switch over to the master, which should mimic SVN
-
Bring master up to date with the dev branch
-
Remove the commits I don’t want to push back to SVN
-
Because I’m paranoid and want to make sure only the commits I want are actually coming through
git svn dcommit --dry-run |
git svn dcommit --dry-run
-
Commit it off to SVN
Changing History
Revise the last 37 commits. Opens up a log in $EDITOR where you can ‘squash’ commits together
Undoing crazy rebases
-
Find the commit you want to bring back, copy it’s sha1 starter
-
Boom, commit is back.
git cherry-pick <sha1 starter></sha1> |
git cherry-pick <sha1 starter></sha1>