views:

77

answers:

2

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)?

+2  A: 

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

Paul Betts
+1. I would do exactly the same thing if I were using Subversion, too.
Greg Hewgill
Because:1. Git is not installed on that server;2. From my former SVN expirience I’ve figured out that trunk (or master branch) is not allways stable (especially when you are not the only developer). And it’s safer and faster to deploy some particular files/changes but not the whole repository.
Sergei Morozov
Install Git on the server (there are portable versions that are XCopy deploy), then make a "production" branch that you can merge to, then have the server pull from that branch.
Paul Betts
+1  A: 

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.

VonC