Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio 2019 Squash Commits via a GUI 👏👏 #26

Closed
spottedmahn opened this issue Jun 6, 2019 · 8 comments
Closed

Visual Studio 2019 Squash Commits via a GUI 👏👏 #26

spottedmahn opened this issue Jun 6, 2019 · 8 comments

Comments

@spottedmahn
Copy link
Owner

Reference: Dev Community: Squash commits in Git using Visual Studio

image

image

image

Warning

Hitting enter on the Squash Commits dialog does not add a line but triggers the Squash button 😱

@corradocavalli
Copy link

Why the menu is disabled in local branches? I see it enabled on remote branches but looks like the commit aren't squashed.
Am I missing something?

@spottedmahn
Copy link
Owner Author

Why the menu is disabled in local branches?

Not for me. 🤔

image

I see it enabled on remote branches but looks like the commit aren't squashed.

That seems backward. Surprised this works:

image

Well, actually it doesn't. The menu items should be displayed for remote only branches it would seem:

image

@corradocavalli
Copy link

The reason of disabled Squash commits menu was a mistake on my side, but honestly is still unclear how this feature work.
My goal is to squash all commits inside a branch into a new one, of course this commits can be pushed to remote branch in different steps, so on remote, at some point, i can have these commits to be squashed: commit1, commit 2 and commit3.
If i squash commits on local branch when i try to push the squashed ones i have an error because there are some changes i need to pull first (think this i because of rebasing behind the squash commit operation)
If i do the same on remote branch, looks like nothing happen on it, but if i then view local branch history i see the squashed commit there, but if i then try to push the local branch is see the same squashed commits requiring to be pulled first.
What is the correct way to use this Squash feature with the plugin? 🙄

@spottedmahn
Copy link
Owner Author

If i squash commits on local branch when i try to push the squashed ones i have an error because there are some changes i need to pull first (think this i because of rebasing behind the squash commit operation)

Sounds like you'll need to --force push in that case

image

I toggle that back off after I need to use it.

@corradocavalli
Copy link

Thanks, it worked, but is this supposed to work this way? after all i think is quite normal, especially when you completed a feature branch to squash commits before submitting a PR...

@spottedmahn
Copy link
Owner Author

Thanks, it worked

🥳😀

but is this supposed to work this way?

Yes, I believe so. A squash is really a rebase and:

No one shall rebase a shared branch

While you're only sharing the branch w/ yourself, I assume, it is shared w/ the remote.

And a rebase:

it’s literally rewriting your project history source

@spottedmahn
Copy link
Owner Author

after all i think is quite normal, especially when you completed a feature branch to squash commits before submitting a PR...

Do you use Azure DevOps? It can squash them for you so you don't have to 😀

@corradocavalli
Copy link

I know, but unfortunately we dont...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants