How to create a new commit/branch/version in github's UI in Visual Studio from two commits within the same branch (combining certain changes)? #138172
Replies: 4 comments
-
Ok, as my changes are not isolated in a separated commit (the commit also contains other changes), I cannot use any git function I guess. Cherry pick only works on commits, you cannot edit the code while cherry picking I guess. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
You're right that cherry-picking works on entire commits, not on specific code changes within a commit. Since you have desired changes in the same branch intermingled with unrelated changes, you could either create a new commit or create a new branch with only specific changes.
NOTE: If you accidentally stage the wrong section, you can unstage it by right-clicking the file in the Staged Changes section and selecting Unstage or use the - icon next to the section. I hope this works for you! |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
So I have a C++ project in Visual Studio and I work with the VS GUI for Github.
Within the same branch, I have different commits. However, there is no particular commit holding only the changes I want to isolate for a particular new version I want to create.
So I wonder how I can best create a new commit/version (through a new branch is maybe best?) that holds a mix of changes from the last commit versus the first commit of that branch (call it branch B). But there is no option for this in the GUI.
I know that if you do a merge of a version into another version you get the option to select the changes you want to keep. But that's between branches, not within. Commit 1 from branch B is also commit e.g. 502 from branch A (master). So maybe I can merge those two somehow (without necessarily using the latest commit from Branch A)?
However that merges the latest version of Branch A (master) into Branch B I guess? Not necessarily what I want.
p.s. My GUI shows two branches in the view window (pic 2), can't seem to get rid of this kind of view (want it to show only 1 branch)
Beta Was this translation helpful? Give feedback.
All reactions