This will be a long one but I hope you could bear with me.
I am trying to use git to put my team's source code under version control. After trying to find different approaches that would work for me, I finally decided to use git format-patch
feature. FWIW, the product is an ASP.NET web application running in Windows and I am currently using msysgit.
Background:
I have a staging server (mirrors production server) which contains all the aspx files. I then created a git repo using init-db inside my root folder and did a git add .
to track all the files.
In order for me to have a local copy on my laptop, I actually zipped up the ".git" folder from the staging server and FTP'ed it to my local machine. Renamed it to "staging.git" and did a git clone staging.git webappfolder
to do my development against.
After doing 2 commits for feature1 and feature2, it's time to apply the changes back to the staging server. I did a git format-patch -2
which outputs to files 0001blah.patch
and 0002blah.patch
.
These 2 patch files are then sent to the staging server and I did a git am 0001blah.patch
on the staging server itself. Doing a git log
shows the commit went through. But when I do a git status
, it shows Changed but not updated: modified: file1.aspx
.
What does that mean exactly? I also tried doing a git apply 0001blah.patch
but all I got was an error" patch failed: file1.aspx: patch does not apply
.
Is there a problem with my workflow? Any insight regarding the proper way or help would be extremely helpful. Again, the patching model would be the most viable for us right now as we won't be setting up an SSH server anytime soon.