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 576551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:03:33+00:00 2026-05-13T14:03:33+00:00

I’ve just started using git, and am impressed with the workflow differences from SVN,

  • 0

I’ve just started using git, and am impressed with the workflow differences from SVN, but I’ve run into one structural/setup question that the documentation doesn’t seem to intuitively explain how to set up, and I’m wondering if it’s even possible.

My setup is that I have several computers I do development from (desktop and laptop), so, to more easily keep in sync and provide backup for the git repository, I set up a “public” bare repository on my home Linux server that I can ssh into from both desktop and laptop. It’s not really public, since it requires SSH access to the box to get to.

My problem comes when I do changes on my desktop, I can easily push changes to the server repository (I have the mirror flag set for the origin remote on that repository), and using gitx I can see that the local and remote states look identical, and each of my individual commits has been logged to the server.

The question is when I switch to my laptop, which I use rather infrequently, the git repository there is likely several commits behind the server version and needs to be updated. I started using git pull to get those changes local, but rather than duplicate all the individual commits on the server to the local repository, it adds one new ‘merge’ commit to the local repository, and gitx shows merging in the remote repository branch at that point.

Is there a command/workflow that would let me update the local repository to the exact state of the remote repository (such that if I do a git push --mirror no data would be lost)? Would I have to delete my local repository each time and git clone it again each time?

Currently no one else would need access to this repository, though in the future it might become a public repository for people to pull from, so answers that don’t destroy that possibility would be appreciated.

Edit: My commits do include rebasing branches off of the master branch; could that be what’s triggering the git pull command to show as a merge? Is the --rebase flag what I need then?

Solution Explanation: It turns out I had done the following to set up my repositories:

  • Use laptop to initialize a git repository
  • Push laptop repository to server (commit A)
  • Made a change and committed it on the laptop (laptop at commit B)
  • Desktop clones server repository (commit A)
  • Make changes on desktop and commit (commits C, D, E, including rebasing branches)
  • Desktop pushes to server (server fast-forwards to E)
  • When laptop pulls from server, results in a merge (since B cannot fast forward to E).
  • Laptop merges, and pushes changes to the server
  • Desktop now has to merge as well.

Because of that one extra commit that was an unintentional newb mistake, it led me to think that it would always be a merge. On Xentac’s suggestion, I went back and found on the laptop that I had made a merge that wasn’t pushed to the server, which was the culprit, and once I got all three really in sync, git pull --ff (forcing only fast-forward merges) works just fine, and warns me if something is out of sync before doing the merge.

  • 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-13T14:03:34+00:00Added an answer on May 13, 2026 at 2:03 pm

    Because you have commits in your laptop’s master branch that aren’t in your server’s master branch, every time the server changes, the laptop can’t just update the master branch pointer. That’s why you’re creating merge commits.

    If you want to continue having changes that aren’t stored on your server but just stored on your laptop, you’ll want to git fetch and then git rebase origin/master. The fetch will download the commits from the server but not change your local branches and the rebase will recreate your laptop’s master branch changes on top of the server’s master branch (origin/master).

    It’d probably be better to not have those commits dangling around though. Can’t they be integrated into the whole codebase to just have one common history?

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

Sidebar

Ask A Question

Stats

  • Questions 441k
  • Answers 441k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to do: public class EnumerableDisposer<T, J> : IDisposable… May 15, 2026 at 5:31 pm
  • Editorial Team
    Editorial Team added an answer Well, these are Perl basics. You should start learning it… May 15, 2026 at 5:31 pm
  • Editorial Team
    Editorial Team added an answer Just use the Control's Focus method: TextBox1.Text = selectedItemText; TextBox1.Focus();… May 15, 2026 at 5:31 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.