Code Monkey home page Code Monkey logo

Comments (3)

goneng avatar goneng commented on June 28, 2024

I think there is a simpler approach:

  1. git reset ("soft") to the prior commit-ID
    (Now, all changes are showing as uncommitted changes)
  2. git add (to a group of files)
  3. git commit
  4. 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.

eordano avatar eordano commented on June 28, 2024

I'll give it a try! Thanks

from gitfixum.

goneng avatar goneng commented on June 28, 2024

If this is what you were looking for,
I would add steps '0.', '5.' and '6.' to the process:

  1. save your current state in temp-branch 'state-before-splitting-commits':
    git branch state-before-splitting-commits
  2. git reset ("soft") to the prior commit-ID
    (Now, all changes are showing as uncommitted changes)
  3. git add (to a group of files)
  4. git commit
  5. Go back to step '2.' until done with all the files
  6. 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)
  7. drop the temp-branch:
    git branch -D state-before-splitting-commits

from gitfixum.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.