We have a build server that is designed to check the version of code from git and build. As a rule, the server will check and build the develop branch, but it can be controlled using the graphical interface to build any specific branch or tag.
Our git archive is large, so we want to run git clone only once. So my question is: what sequence of git commands should be issued in order to update the current working directory with respect to the remote git archive.
My initial naive attempt just did git checkout <branch> and then git pull . But this did not take into account all the artifacts created by the previous assembly that needed to be deleted, as well as some automatic code modifications performed by the assembly process, for example. version numbers in assembly files.
So, it seems to me that we need a sequence of commands for
- Get rid of any changes in the local directory
- Update your local repository to enable ALL commits from the remote server.
- Place an order on the named branch or tag
Please keep in mind that the specified branch or tag may not yet be known in the local repository. For example, if a new branch release/xxx is created on the remote server, this will not be known a priori to the local build machine. This is another of the problems that my naive approach came across.
And finally, it is possible that the git server can sometimes correct the history. I am sure that this will be a rare event, but it would be desirable if the integration server did not need to be configured after overwriting the history.
Many thanks
git continuous-integration
Rob
source share