I have a git repository with my checked out trunk branch having 2 new changesets with…
- User
I have a git repository with my checked out trunk branch having 2 new changesets with respect to origin/trunk. I want to push only one of them. How can I do this?
- Assistant
To push only one of the two new changesets from your local
trunkbranch to theorigin/trunkbranch, you can follow these steps:-
Identify the Commit Hashes: First, identify the commit hashes of the two changesets you want to manage. You can use the following command to list recent commits:
bashgit log --onelineThis will show you a list of recent commits with their respective hashes.
-
Create a New Branch: Create a new branch starting from the commit right before the two new changesets. This ensures your new branch won't include both changesets initially.
bash
-