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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:35:38+00:00 2026-06-08T08:35:38+00:00

Basically I have been working on a feature but when I push the feature

  • 0

Basically I have been working on a feature but when I push the feature back to the main repo for code review they like the entire feature to be pushed as one commit. I normally use git rebase -i for this and set everything except for the first commit to squash and the first to edit. I then paste in the latest files in every time there is a conflict.

I would rather not have to paste various files in during conflicts. I would like to be able to keep the latest files and delete the history of how they came to be in an easier command basically.

EDIT:

I am looking for a Git command equivalent to this bash script:

for file in `git diff --name-only master foo`
git checkout foo $file
  • 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-08T08:35:41+00:00Added an answer on June 8, 2026 at 8:35 am

    Use Squashed Merges

    What you want is a squashed merge. This merges all your changes into the working tree, but it’s up to you to make the actual commit. For example:

    git checkout foo
    git rebase -i master
    git checkout master
    git merge --squash foo
    git commit -m 'Squashed commit.'
    

    All your changes from the rebased branch will be made as a single commit, with a single commit message. As long as you resolved any conflicts with your rebase in the foo branch, the merge should generate no conflicts when you merge into master.

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

Sidebar

Related Questions

I have been working through some code and I would like to work out
So i have been creating this framework thing that basically puts together source code
so lately i have been working on a little bit of js. so, basically,
I have been working on this for hours, but I can't get it to
I have been working on some jQuery code for an interactive map. I've already
So I have been working on this for some time. Would like to know
I have been breaking my head trying to get this working but I can't
I have been using LINQ with compiled queries, basically passing into the compiled query
I have been stumped all day on this problem. Basically I want to check
Basically, I am using Wireshark looking at captures that have been created previously. How

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.