let's asume, I have a repo. there are separate branches. branch A & branch B. branch A has 15 commits and branch B has 10 commits. now I am working on branch A and doing some changes and committing it locally. basically, it will commit number 16 for branch A, but I want to push these commits on branch B. I want to say that I want to push only the latest change(only commit no 16) on branch B from branch A. How it will possible?
Asked
Active
Viewed 765 times
0
-
1You're looking for `cherry-pick`. Does this answer your question? [What does cherry-picking a commit with Git mean?](https://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean) – TTT Apr 29 '22 at 18:22
1 Answers
0
If I'm interpreting your question correctly, you are looking to push changes from a specific branch.
git push origin <branch-name>
You should be able to execute this regardless of which branch you are currently on. Note that this assumes your local and remote branches have the same name.
In your example, executing git push origin branch-B
should do the trick.
I suggest reading some additional answers on this thread.

ExplosiveFridge
- 190
- 1
- 6
-
I want to push specific commit in other branch. Generally, when We execute this command ( git push origin
), this command push all commits in – Ashish May 04 '22 at 06:11from where are currently. but I don't want this. I want to push only specific commit or leatest commit in .