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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:34:58+00:00 2026-05-16T04:34:58+00:00

In some settings, I am used to using git locally, and then exporting a

  • 0

In some settings, I am used to using git locally, and then exporting a diff which is then submitting with a detailed description. Thus, when I develop locally, I commit constantly, and don’t bother with meaningful commit messages or perfect testing before committing.

However, when using git to publish code on github, I would prefer to erase the history of those little commits and create just one commit that represents logical well-tested change.

What would be the best way to achieve this, without changing my local workflow of committing whenever I feel like I’ve explored a little path (however unproven)?

  • 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-16T04:34:58+00:00Added an answer on May 16, 2026 at 4:34 am

    If you look at “Trimming GIT Checkins/Squashing GIT History“, you can:

    • git rebase --interactive --fixup for squashing a commit you would have manually reordered in the commit edit list of a rebase --interactive, while ignoring the second commit message, which will make the message edition step faster (you can just save it: the squashed commit will have the first commit message only)
    • git rebase --interactive --autosquash for making the commit reordering process automatically for you.

    That is why I like to pick a standard comment for all the micro-commits I make, per activity.
    The first micro-commit will contain “my activity”.
    All the other will contain “squash! my activity”

    Several activities (set of micro-commits) can be intertwined in this process.

    All there is left for you is a git rebase --interactive --autosquash for all those micro-commits to be reordered and then squashed.


    The OP namin mentions the blog post Our Git Workflow: Private Development, Public Releases as a good illustration, base on git merge --squash:

    (see also:

    • In git, what is the difference between merge --squash and rebase?
    • Git: after preparing a real merge commit, how to create a simple commit?

    )

    alt text

    We maintain 3 branches for each of our client libraries:

    • master — Active development occurs on this branch.
    • release — Development for bug fixes happens here. We also bump versions and update the changelog on this branch.
    • github_master — We squash commits from the release branch into single “release” commits on this branch as well as tagging releases. This branch tracks github/master.

    We’re now ready to move to the github_master branch.

    git checkout github_master
    

    We want to merge the changes from release into the github_master branch but we don’t want to see each individual commit.
    Git helps us out here with the git merge --squash command. This will merge all the changes from a specific ref, squash them into a single set of changes and leave the changes staged. We commit the staged changes with the message “1.0.0” and tag the commit.

    git merge --squash release
    git commit -m "1.0.0"
    git tag 1.0.0 -m "1.0.0"
    

    With the commits squashed and tagged, it’s time to push to github.
    We want to push the current branch’s HEAD to the master branch on the github remote.

    git push github HEAD:master
    

    Last but not least, we need to push these changes to the branches on origin and merge the squashed commit back to release and master.

    You may suspect that git would be confused merging a squashed commit back into branches containing the non-collapsed commits, but it all works just as expected. Git is smart enough to realize no changes need to be made when merging in the squashed commit, but we should still merge to keep our branches in sync.

    git push origin github_master
    
    git checkout release
    git merge github_master
    git push origin release
    
    git checkout master
    git merge release
    git push origin master
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using nhibernate to store some user settings for an app in a SQL
I have an application which tries to load some expected registry settings within its
I am using a PreferenceActivity to show some settings for my application. I am
I recently created a (C#) project with Visual Studio (2010) and used some Settings
I have some settings I need in a Javascript file -- servers to connect
We have a service that has some settings that are supported only over net.tcp.
I want to create an ini file to store some settings for my application.
I have some stuff in settings.py that I'd like to be able to access
Some projects have properties have miscellaneous settings such as: AllowPayments, ShowSideBar, SectionTitle. Really things
I'm trying to save some XML-Data in my UserSettings (Properties.Settings.Default.UserSettings) in a .NET Winforms

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.