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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:25:03+00:00 2026-05-23T18:25:03+00:00

Is it possible to join various commits? This is my case: My app runst

  • 0

Is it possible to join various commits?

This is my case:

My app runst in OSX 10.6 and 10.7 so
I have fixed some stuff for 10.6 then committed,
changed to 10.7 and fixed the fixes again so they are compatible, then commit again.
then went back to 10.6 and check it again and make a small commit again, etc.
(three or four commits in total and all these commits are for the same issue)

As you see all these commits are closely related so I would like to join them, Is this possible?

I still have to work in one more issue so I don’t plan to merge the current branch.
Ideally I would like to have only one commit per issue/bug I solve.

EDIT:

I have pushed my commits since I have to do this in different computers but the branch is not being used by someone else, not yet.

  • 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-23T18:25:04+00:00Added an answer on May 23, 2026 at 6:25 pm

    A nice, interactive way is with git rebase -i. Check out a branch, look at the history, and pick a commit that’s before the first commit you want to “join” (it’s called squashing). Then

    git rebase -i <the commit>
    

    In an editor, you’ll be shown a list of commits from the one right after the one you chose to the most recent one. It looks like

    pick 2f4b7fa Some commit message
    pick 19f58bd Some other commit message
    

    Find the first commit in the ones you want to join. Leave that one set to “pick”. Then, for all the ones you want to squash into that, change the “pick” to “squash” or just “s”. Marking a commit “squash” means that it will be combined with the commit immediately before (above) it. Then save and exit. You’ll be prompted for a new commit message for the new commit that will be created. Save that and exit, and you’re done. Note that you can also use the rebase view to move commits around by shuffling the lines around. So if you have some commits that are out of order or you need to move commits together to squash them, you can do that, too. Another note: if you’ve pushed your commits to a remote, this can jack things up, especially if you’re working with other people who pull from that remote.

    Edit: Since you’ve pushed the branch already, and you know that nobody else is using it, just follow the above steps, and then do a git push origin master -f, assuming the remote repo is “origin” and you’re on the master branch. That’s a normal push, but the -f tells it to overwrite whatever is on the remote and force your changes to be applied instead. It’s when you’re working from a repo shared by others that this becomes dangerous and/or confusing.

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

Sidebar

Related Questions

Possible Duplicate: Join lines based on pattern I have the following file: test one
If I have a context menu, is it possible to join it to another
I have a query, that does a LEFT JOIN on a subselect. This query
What I have: Let's say I have a hash like this, with various values
Is it possible to join two sockets? For example, if a process is acting
Is it possible to join two classes without specified mapping between them (using Criteria
Is it possible to do a cross table join in mysql spaning different tables?
Is it possible to do a join to a nested select statement in SubSonic
Is is possible to accomplish the equivalent of a LEFT JOIN with subselect where
Possible Duplicate: What's the difference between NOT EXISTS vs. NOT IN vs. LEFT JOIN

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.