Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundle commits / keep commits private on push

Tags:

git

mercurial

I want to keep some commits private on push, so I want that they get bundled into one big commit on the remote side. Locally they should remain splitted.

A use case is for example the work on a static blog. The draft steps should be commited and tracked locally but on push I want only publish released versions.

A solution in git and/or mercurial will be accepted.

like image 325
schlamar Avatar asked Jan 16 '23 17:01

schlamar


1 Answers

In Mercurial 2.1 and later you can use phases to mark changesets as "secret". This will mark all outgoing changesets as secret:

$ hg phase -f --secret "outgoing()"

A secret changeset is not pushed or pulled by default, so after that command there wont be any outgoing changesets — adjust as needed to mark the right changesets as secret.

You also say you want the changesets as one big commit in the remote repository. For that you can use the histedit extension bundled with Mercurial 2.3 and later. Use the --keep flag so that it wont remove the original changesets when you collapse them.

like image 107
Martin Geisler Avatar answered Jan 19 '23 00:01

Martin Geisler