Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 191841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:22:32+00:00 2026-05-11T16:22:32+00:00

This will be a long one but I hope you could bear with me.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:22:32+00:00Added an answer on May 11, 2026 at 4:22 pm

    I just tried this:

    rm -rf clone?
    
    # clone 1 is the working copy
    mkdir clone1
    (
        cd clone1
        git init
        echo foo >> file1
        git add file1
        git commit -m "Initial state"
    )
    
    # clone 2 is the staging repo
    git clone clone1 clone2
    
    # create patches
    (
        cd clone1
        git tag staging # tag to track what's in staging
    
        echo feature1 >> file1
        git add file1
        git commit -m "Feature 1"
    
        echo feature2 >> file1
        git add file1
        git commit -m "Feature 2"
    
        rm *.patch
        git format-patch staging
    )
    
    # apply patches
    (
        cd clone2
        git am ../clone1/*.patch
        # Cygwin/msysgit line ending weirdness when patching. Aborting and
        # reapplying clears it up.
        git am --abort 
        git am ../clone1/*.patch
        git log
        git status
    )
    

    Has the minor issue with the patches not applying clearly without doing the am twice, but I end up with a clean working dir in clone 2 with the right contents of file1. So there doesn’t seem to be anything wrong with your workflow per se.

    Git apply will only update the working tree, not perform a commit.

    That said, I wouldn’t use a git repository for staging. My workflow would probably make a release branch / fork of the development repository (or not), and just deploy full clean copies of that.

    For incremental updates to the staging environment, just use git tag staging in the release branch, “git diff staging..HEAD > update.patch” to email, and the standard unix “patch -p1” to apply it should work. That is unless you really need have the change history physically on the staging server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im sure this will be a simple one but have a project that started
this post is a long one sorry for that but the problem is complex
This will hopefully be an easy one. I have an F# project (latest F#
I think this will be easy but I can't see how to do it!
I would like to do the following but I don't think this will work:
This is a long shot, but is there any way to get some of
This will require a little setup. Trust me that this is for a good
Hopefully this will not spark a religious war... We have a web based app
I know this will be a difficult question, so I am not necessarily looking
Not certain if this will get much response due to the newness of Windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.