Comments (3)
I think there is a simpler approach:
- git reset ("soft") to the prior commit-ID
(Now, all changes are showing as uncommitted changes) - git add (to a group of files)
- git commit
- Go back to step '2.' until done with all the files.
Cheers
Gonen Goshen
052-6116506
ב-1 באפר 2014, בשעה 17:18, Esteban Ordano [email protected] כתב/ה:
This is a change that I sometimes want to introduce and I always end up tagging the commit to be rewritten, reset --hard to the previous one, checkout file by file and add -p to make sure I'm adding just what I need, and a rebase of the older branch. I find this process to be painful, very painful (and I couldn't think of a better way); and I was wondering if you had any ideas to make it easier to digest.
—
Reply to this email directly or view it on GitHub.
from gitfixum.
I'll give it a try! Thanks
from gitfixum.
If this is what you were looking for,
I would add steps '0.', '5.' and '6.' to the process:
- save your current state in temp-branch 'state-before-splitting-commits':
git branch state-before-splitting-commits - git reset ("soft") to the prior commit-ID
(Now, all changes are showing as uncommitted changes) - git add (to a group of files)
- git commit
- Go back to step '2.' until done with all the files
- Confirm all is same as before - compare to the original state:
git diff state-before-splitting-commits..HEAD
(if all is well - there should be NO differences) - drop the temp-branch:
git branch -D state-before-splitting-commits
from gitfixum.
Related Issues (19)
- Markdown link not linkifying HOT 1
- Rewriting History HOT 2
- slight bug HOT 4
- License? HOT 1
- Thanks for the adventure
- this = shit
- Sorry, i didn't see the gh-pages branch, issue closed.
- Removing multiple commits. HOT 1
- THANK YOU
- Thanks!!!
- Someone forked and continued this project
- Thank you :)
- Funny link ("Yes I want to remove an entire commit") HOT 1
- How git only maintain 15 days of history. HOT 2
- Replace preserve-merges with rebase-merges HOT 1
- Add offline support HOT 3
- web app HOT 1
- I did a terrible terrible thing. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitfixum.