Cydonia7
Cydonia7

Reputation: 3826

Git deployment issue

I am using Git to synchronize application files between my server and my development computer. It works really well but there is still a problem left.

I maintain a deploy script within the current git directory that is automatically executed on the server whenever I push something via hooks. However, when I want for some reason to go back to a previous version, then it firsts pulls the previous version and executes the version of the script at this revision.

However, over time, the deploy script has become more and more powerful, and I would like to always have the last version.

Is there a way I can make sure that whenever Git checks a version out, the deploy file always stays at the latest version?

Upvotes: 0

Views: 28

Answers (1)

VonC
VonC

Reputation: 1323303

when I want for some reason to go back to a previous version, then it firsts pulls the previous version

You can add an intermediate step which would checkout the deploy script file at the last revision of a branch (see "Reset or revert a specific file to a specific revision using Git?").

git checkout aBranch -- aSCriptFile

Upvotes: 2

Related Questions