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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:07:49+00:00 2026-06-16T19:07:49+00:00

I currently use git the following way: clone, fetch repo create topic branch for

  • 0

I currently use git the following way:

  1. clone, fetch repo
  2. create topic branch for specific issue
  3. do some commits on it
  4. checkout master branch
  5. merge topic branch to master
  6. push new master branch

Unfortunately this is getting messy from time to time. What I would like to do is to merge some smaller commits to a bigger one.

Also it would be sometimes a good idea to merge all commits in a new branch to one commit and merge this to master.

example:

git branch update-docs
git checkout update-docs
git add -A .
git commit -m 'updated networking doc'
git add -A .
git commit -m 'updated manager doc'
git checkout master
git merge update-docs

As you know now I would have two commits in master branch “updated networking doc” and “updated manager doc”.

If I would now want only have one commit in master branch called “updated docs” for example which contains the changes of these two commits what do I have to do?

I think you have to use git rebase for this sort of task. I just do not know how to use it.

I already tried:

git checkout master
git rebase update-docs

but that merged the changes to master without leaving any commits and now the repo is messed up.

So would somebody share the commands you have to use?

Solution:

git checkout -b update-readme
git commit -am 'rewritten readme'
git commit -am 'added author name'
git rebase -i master

opens text editor:

pick 6dbcbf1 rewritten readme
pick b815bbf added author name

now you change this to:

pick 6dbcbf1 rewritten readme
squash b815bbf added author name

then you save with “:w” and “:q” if using vim and it will open another editor where you can define the new commit name

rewritten readme

then you merge the repo:

git checkout master
git merge update-readme
  • 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-16T19:07:50+00:00Added an answer on June 16, 2026 at 7:07 pm

    After git merge update-docs, execute git rebase -i origin/master. This will pop up an interactive rebase editor, which allows you to squash commits and otherwise rearrange them.

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

Sidebar

Related Questions

Currently, before merging a branch, I use the following commands to see what changes
I use the following command to push to my remote branch: git push origin
I tried to use git cherry-pick for merging some commits from master and then
I currently use: BufferedReader input = new BufferedReader(new FileReader(filename)); Is there a faster way?
I currently have git and virtualenv set up in a way which exactly suits
I am presenting Git to a 10 man programming team who currently use Visual
So the branching model I usually use is similar to the following: http://nvie.com/posts/a-successful-git-branching-model/ However,
I currently use Zend_Db to manage my queries $stmt = $db->prepare(INSERT INTO test (ID_Test)
I currently use Devise 2.1 + Rails 3.2.x to authenticate users. I'm also going
I currently use the rectangle shape xml tag to specify borders for my views

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.