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

  • Home
  • SEARCH
  • 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 125307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:08:17+00:00 2026-05-11T05:08:17+00:00

Git newbie here. Is there a way to synchronize two repositories, so that the

  • 0

Git newbie here. Is there a way to synchronize two repositories, so that the current checked out files will be the latest version of all the changes?

What I have is this:

Desktop       Server -------       ------ Change_X      Change_Y 

And I would like to enter some ‘magic’ command, and then the changes are merged

Desktop       Server -------       ------ Change_X      Change_X Change_Y      Change_Y 

One of the problems is that the desktop is a Windows machine behind a NAT, and I would like to avoid having to set up sshd on it. Basically I would like to do it all using ssh from the desktop to the server.

This seems like it should be trivial to do with git, but I couldn’t figure out how to do it.

(I thought git push would do the trick, but it turns out it doesn’t make changes to currently checked-out branches, so the changes from the desktop don’t get to the server)

Is there a way to do this with git, or am I off the track?

Solution: I downloaded the post-update script from here and put it in the hooks directory on the server, and now git push causes the server to update with the changes. So basically the ‘magic command’ resolves to:

git pull server:scripts/ master git push server:scripts/ 

(scripts is the folder I’m synchronizing)

  • 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. 2026-05-11T05:08:18+00:00Added an answer on May 11, 2026 at 5:08 am

    it should be possible to create a post-commit hook that will update server’s working copy on change (I did exactly the same with mercurial, so i assume it would be possible with git too). so after you push, working copy will be updated automatically.

    create post-commit hook that will run git up or whatever equivalent command for git is.
    i’m sorry i don’t know what else to say.
    upd: there is some explanation in official git faq.

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

Sidebar

Related Questions

Git newbie here. I am probably making a simple mistake here, but I can't
I'm a newbie to Git. I'm exploring one-way one-time migration of Git repository to
Hey, so I'm a complete git newbie here, the most advanced thing I've done
git newbie here, bear with me if this is trivial. I cannot find this
Newbie with git here. I have a Remote Repository, cloned on my PC. It's
I will work with one designer that does not know anything of Git. I
Git newbie here. Using Xcode 4.3.2. Had to move my project file directory. Commit
I'm a Git newbie. I recently moved a Rails project from Subversion to Git.
I am newbie with git. It tried this tutorial, but after the command, i
I'm a newbie at git and want to understand how to collaborate with a

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.