1

Here's the situation...

I need to be able to rebase a git repository branch to a point in time, then remove (and stash or keep) my commits beyond that point in time. Retaining the ability to re-apply every thing... but not having them living in the remote repository...

Reason (maybe you'll have a better solution)

Have a contract job that I've been working on for a few months, and they are refusing to pay... I want to be able to rewind the repo to the beginning of my involvement, remove ( and store) my work to be re-applied on payment..

The complicated issue is that there have been other users committing in tandem and I don't want to remove those, but it will obviously break if I yank intermittent commits and attempt to run the repo at the same point (not-rewinding the active copy).

Ideas? (Technical) ... Thought about using a git patch?

jondavidjohn
  • 61,812
  • 21
  • 118
  • 158
  • How would you handle the case where someone worked on the the same code that you introduced? You couldn't exclude their work without including your work. – Andy Nov 17 '11 at 17:01
  • I don't need a perfect solution, It would be enough to exclude my own commits. As long as it can be re-applied. – jondavidjohn Nov 17 '11 at 17:02
  • Since git is distributed, the others will also have a copy of your past work. It'll be difficult to roll those changes back. – ldav1s Nov 17 '11 at 17:06
  • @Kiley I know... classic case of assuming there are certain people in life that you can trust (even in buisness)... – jondavidjohn Nov 17 '11 at 17:07

1 Answers1

1

Create a remote tracking 'paid' branch (could be the master branch) and some feature (hostage) branches. As soon as you get your money, you rebase your features onto the paid branch and push it to your client.

Hendrik M Halkow
  • 2,208
  • 15
  • 24
  • Clever... but I'm afraid the paramount issue that I won't be able to overcome is the distributed nature, and others on the team having local copies of everything... – jondavidjohn Nov 17 '11 at 17:10
  • 1
    Well, once it's on the internet, it's on the internet. So the think twice before you push. And use the distributed nature to your advantage: You don't need to consider every commit that was created by somebody else, but you could. So rebase onto the good ones and prune the rubbish ;-) – Hendrik M Halkow Nov 17 '11 at 17:24