Re: [git-users] A simple task But I haven't read much
On Wed, Mar 18, 2015 at 04:05:18PM -0700, Dryden wrote: > Alright so, I succeeded in what I wanted to do, but I do not know > how I did it. > > I was trying to rewrite history. > > I first pushed the entire tree onto a different empty node and > pushed it with "git push origin +master" onto the GitHub tree. > > I make backups regularly of the local repository copy so I can go > back to what I did before. > > I really have no idea how I did it. Clearly, one lesson to learn from this is to be a bit more organised when messing around... keep a journal ;) > My goal was this: > > - remove one file from an older commit > - put it alone in a new commit I would do this to achieve that goal: 1. % git rebase -i HEAD~5 2. mark the commit for 'edit', save and exit 3. % git reset HEAD^ 4. add all but the one file, then commit 5. add the one file, then commit 6 % git rebase --continue /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus If voting could really change things it would be illegal. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. pgpOl8yc6UGjG.pgp Description: PGP signature
[git-users] A simple task But I haven't read much
Alright so, I succeeded in what I wanted to do, but I do not know how I did it. I was trying to rewrite history. I first pushed the entire tree onto a different empty node and pushed it with "git push origin +master" onto the GitHub tree. I make backups regularly of the local repository copy so I can go back to what I did before. I really have no idea how I did it. My goal was this: - remove one file from an older commit - put it alone in a new commit Eventually I learned how to rebase the wanted commit minus that one file onto the empty root (it effectively becomes the new root if you let it). But I guess I did it by just creating a huge amount of commits and then deleting the ones I did not want :p. At one point it worked the way I wanted but then I forgot how to do it. Eventually I just messed about until it worked. Seriously why is this so difficult. Okay I haven't read much about the construction of the Git tree, but still. It seemed like I could remove a file from a commit by going back with "git reset --soft HEAD~3" or the like. Then everything that had been committed after that fact would end up as "new files" in this case. I could then remove the offending file and then redo the first next commit I had wanted to do. So far so good. But I don't know how to redo commits. It seems like "git commit -a -c ORIG_HEAD" might redo up to the original (furthest) head? No, it does a single commit. It might work. But I still don't have a way to do this. 1. Reset up to the commit to change. 2. Reset a file from that commit. 3. ?? 4. Profit. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.