5

I'd like to have some modifications that are private to my fork. How do I go about doing this?

There's a question here about pushing a single commit, and the answer is to cherry-pick the commits you want to push from a private branch and put them on the main branch. However, I would like something more along the lines of ignoring a certain commit when pushing.

Community
  • 1
  • 1
int3
  • 12,861
  • 8
  • 51
  • 80
  • 1
    If this is really necessary, then I'd have to ask if these items should be part of your repository? – Paddy May 19 '10 at 20:32

2 Answers2

2

If those commits are part of commits not yet pushed, you can:

  • reoder them (rebase --interactive) to put them as the most recent commits
    (actually, if they are sequential, you can rebase --onto another branch altogether)
  • make a branch "private" to mark the tip if the current "dev" branch
  • reset that dev branch to the last commit before those private ones
  • push dev branch.

So the solution still involves a "private" branch in the process, but more importantly it is about isolating (hence the branch) the part of history which is not made to be published, ending up with a clearer "public" history for you to publish (push).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • But this would mean that each time I wanted to do a push, I would have to run through this process again. Is there a way to automate this? – int3 May 19 '10 at 20:20
  • 2
    @int3: as long as you keep separate your private commits (made on the private branch) and your public commits (on the public branch), you can: 1/ rebase your private branch on top of your public branch anytime you want to have a full environment. 2/ push only your public branch. So you commit as usual except than when a commit is made on the public branch, a rebase of private (on top of the updated public branch) must be done in order for you to go on with a complete workspace. – VonC May 19 '10 at 20:28
0

why not make a fork of the main branch and ask the owner of that branch to make a pull? Kind of like github style?

Zepplock
  • 28,655
  • 4
  • 35
  • 50