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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:46:11+00:00 2026-05-23T14:46:11+00:00

I sync my development code on 2 machines using a git bare repository on

  • 0

I sync my development code on 2 machines using a git bare repository on a usb drive (followed these steps git setup for backup & sync between 2 computers).

I push my changes to the bare repo on the USB and then fetch & merge on the other machine.

My understanding was that these 2 commands are same, but their output is different. The log shows that the first command creates a new branch.

Method 1
git fetch origin
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /usb/backup/code
 * [new branch]      master     -> origin/master


Method 2
git fetch /usb/backup/code.git
From /usb/backup/code
 * branch            HEAD       -> FETCH_HEAD
  • 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-23T14:46:12+00:00Added an answer on May 23, 2026 at 2:46 pm

    That is because:

    git fetch origin 
    

    is the same, when git remote is configured by default, than

    git fetch origin +refs/heads/*:refs/remotes/origin/*
    

    It will tell Git what to fetch and where to store the resulting commit.

    But:

    git fetch path/to/.git
    

    means you don’t benefit from the default refspec setting origin +refs/heads/*:refs/remotes/origin/*, which means you are doing:

    git fetch path/to/.git HEAD:
    

    (you fetch the remote HEAD without specifying where to put it).
    The resulting commit is stored in FETCH_HEAD ref.

    See “Having a hard time understanding git-fetch” for more.
    (and “git fetch with path instead of remote“)

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

Sidebar

Related Questions

How do I sync all the code in the SVN repository (for development purposes)
I'm using rsync -avlz to sync files between my development server and my production
I recently had a question answered about a multi-computer git development setup, and the
I have two development machines. One machine is setup to use a specific Mercurial
I'm using Microsoft Sync framework 1.0 (without ADO.NET services) I have created 2 custom
At work, development uses perforce to handle code sharing. I won't say revision control,
I was reading over at the Android development website about using reflections. But I'm
I'm using the Microsoft Sync Framework to synchronize a SQL Server database with a
I am developing a website using SQL Server Express on my development machine. My
I am setting up Git and trying to use this. We have a development

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.