github - Git rebase leaves current branch behind remote, want a cleaner commit history -


i upload commits local git repo github regularly, overloaded commits, , after deciding not useful , spoil history, tried using rebase -i squash of commits together.

it seemed work, wanted push changed commits github , change history there. tip of current branch behind. , suggested action pull changes remote repo, don't want changes remote. want send have locally github.

can please explain me situation bit , achieve want?

to edit pushed branches no-go, can it.

maybe commit log looks this:

o 250a32c added new information <master> <origin/master> | o c4f5265 added new information | o 168d674 added new information | o ca708cd other commit 

you can interactive rebase squash commits.

git rebase -i ca708cd 

an editor opens , can change pick before commits 250a32c , c4f5265 squash.

after this, repo looks this:

o 3e86bc4 added new information <master> | o 250a32c added new information <origin/master> | | | o c4f5265 added new information | | | o 168d674 added new information |/ o ca708cd other commit 

now have need push branch github --force, because master , master/origin out of sync , cannot fast-forwarded.

git push --force origin master 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -