I'm about to set up and automated build environment for a client. I want to push the Git repository to the client's build server, but without complete Git history.
I'm thinking about an approach with git checkout --orphan ci
, but it's unclear to me how to work on a daily basis with a branch setup like this.
Maybe something like this (?):
- New commits will be created on the
master
. - A feature is finished after several commits.
- The
ci
branch is then rebased/merged (fast-forwarded) on themaster
. ci
branch is checked out.- The recent commits (which are not pushed to any server yet) are squashed to hide unnecessary history from the client.
- The
ci
branch gets pushed to the build server. - ...
Is that a valid approach and/or does an easier way exists?