Deploy changed files using Git
I’ve come to Git from SVN. Formerly in order to update some production site I compared revisions from production one to HEAD using TortoiseSVN, exported changed/added files into a temporary directory 开发者_如何学Goand after that uploaded them onto production server.
Is it possible to reproduce the same using Git (TortoiseGit)?
The compare Dialog of TortoiseGit is more about File, and, with Git, you have to compare two master
branches (not just two commits of the same branches both pointing to the same SVN central repo)
If you have git directly on the server, you could rebase your master (of the server repo) with the origin/master (the one of the development repo)
Or you can reset your prod master HEAD to the origin/master and add the files, as described here.
But if you have only Git on the development side, which is wise, you can have:
- a cloned version (called "prod1" for instance) of the repo representing one of your production side (prod1/master)
- or a branch within your own repo (called "prod1_master")
In both case, you need to list all files that have changed between prod1 and master:
git diff --list-only prod1/master
git diff --list-only prod1_master
export those files into a temporary directory that you can compress and uncompress on the prod side.
Why don't you make your production site a Git checkout, then to deploy the added / changed files, you just git pull?
精彩评论