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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:03:51+00:00 2026-06-12T21:03:51+00:00

i am wondering what happens if you squash between branches and push/pull from remote

  • 0

i am wondering what happens if you squash between branches and push/pull from remote in between.

DEVELOPER 1
1. $ git checkout foo
2. $ git commit -m 'changed file' file.txt
   $ git commit -m 'changed another file' file2.txt
3. $ git push

DEVELOPER 2
4. $ git checkout foo
5. $ git pull    // gets commits from 2. above
6. $ git checkout bar
7. $ git merge foo
8. $ git rebase -i HEAD~3

in 1 – 3 — i make some local changes to some files, commit them separately, then push.
in 4 – 8 — someone else pulls my commits, checks out another branch, merges the first one, then tries to squash the commit in the merge.

would this mess up history, is it “bad”?

  • 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-12T21:03:53+00:00Added an answer on June 12, 2026 at 9:03 pm

    git rebase -i HEAD~3 would replay commits (squashed or not) in the bar branch, leaving the ones referenced by the branch foo untouched.

    It is bad if your branch bar was already pushed (see “git rebase develop branch“), because you would need to force push it and make other developers on bar in trouble.

    But it is also bad in that it will duplicate commit contents (between those of foo branch, and the one(s) squashed on bar, making any future merge from foo to bar to apply again commits 2 and 3.
    That is where the option -p (--preserve-merges) of a rebase can come in handy, in order to preserve the parents of a merge. But that might not be compatible with what you want to do (squash).

    In general, try to not modify a public history that you just pulled (like commit 2 and 3 on branch foo)

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

Sidebar

Related Questions

I was wondering what happens if from the kernel (Linux in this case) you
I'm wondering what happens when I use a MKReverseGeocoderDelegate in my ViewController, but the
I'm wondering what happens after the constructor is done executing my code, because the
I'm going through the django tutorials and I was wondering what happens when you
I was wondering if anyone happens to know of a jQuery (or pure javascript)
I was wondering if there was any resources available online that explains what happens
I am wondering what happens if I schedule a Bean method with @Scheduled at,
I was wondering what happens when a program processes an if-structure with multiple conditions.
I was wondering what happens to the code contained in an <mx:Script> tag. If
I'm just playing around with some PHP and was wondering what happens when an

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.