Question

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 and after that uploaded them onto production server.

Is it possible to reproduce the same using Git (TortoiseGit)?

Was it helpful?

Solution

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.

OTHER TIPS

Why don't you make your production site a Git checkout, then to deploy the added / changed files, you just git pull?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top