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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:54:39+00:00 2026-06-02T06:54:39+00:00

I am collaboratively working on a project with someone, so we decided to use

  • 0

I am collaboratively working on a project with someone, so we decided to use git. Unfortunately, we frequently code in locations with no internet, so we end up with something like this:

origin/master: A---B---C
                        \
mylocalmaster:           D---E---F
                        \
hismaster:               G---H---I

Now, say he pushes his commits and gets this:

origin/master: A---B---C---G---H---I
                        \
master (local):          D---E---F

All I want to do is push my commits to get this in both my local repo and the online one:

A---B---C---D---E---F---G---H---I

It seems to work when I do git push, but the trouble arises when I do git fetch and then git merge. All I’m trying to do is get his commits into my local repo, but I end up with a merge commit saying something like Merge remote-tracking branch 'origin/master' as its message.

I don’t want to have this pointless commit, since there is no conflicting code in our commits. We are working on completely different files, so there’s no reason to have this commit. How can I prevent git from creating this merge commit?

  • 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-06-02T06:54:40+00:00Added an answer on June 2, 2026 at 6:54 am

    You can omit creating merge commits, by using rebase instead of merge.

    As @Dougal said, if you do git fetch, you can execute git rebase afterwards to change the base of your changes to the fetched HEAD.

    Usually you create those unwanted merge commits, by pulling from remote repository.
    In that case you can add --rebase option:

    git pull --rebase
    

    or add the proper option to Git config file (locally):

    git config branch.<branch-name-here>.rebase true
    

    or for all the new repositories and branches:

    git config branch.autosetuprebase always --global
    

    However, rebasing creates cleaner, more linear history it is good to create merge commits, where there are massive changes in both branches (use git merge to do so).

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

Sidebar

Related Questions

We're an opensource project and would like to collaboratively edit our website through github
I am working on a collaborative project in Java, and thought it would be
I'm working on a large collaborative C++ project that is both developed and run
I want to code/debug collaboratively on a shared linux terminal (so that both parties
I'm writing a collaborative project designed to allow code contributions from users. Users will
I am working on a Drupal project where I need the following: Deployment using
I recently stumbled upon Etherpad, it's a collaborative writing tool http://code.google.com/p/etherpad/ - main project
I'm working on a collaborative project and the guy who controls the master branch
I've got a really annoying problem: I'm working on a collaborative text editor in
I'm working on a website with some other people. Usually when we want to

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.