I've created a deployment tool for colleagues (developers) to simply press a button to deploy code from bitbucket to a remote server. Two things will occur
- SSH into server (target address)
- Run a git command here to pull the code
The problem lies in my lack of git knowledge. Repositories may have tags and so there is more to this than just 'git pull'. Presuming the repo has already been cloned, so it exists, how would I pull code to the server using a specific tag?
One thing I was thinking is that latest tags that people create on bitbucket may not exist on the server, so when they deploy and enter this tag, how will the server know this tag exists? Will I need to pull all and then pull the specific tag?
I figure these 3 are what I may possibly need - pull, fetch, checkout.
What would be the best git command(s) to ensure a remote server can pull the correct code from a specified tag, even if the repo has been heavily updated and new tags added?