The cherry-pick feature will do the job and will only apply the last commit:
Considering branches A, B
git checkout A
git commit -m "Fixed the bug x"
git checkout B
git cherry-pick A
hope this helps!
More Related Contents:
- How do I resolve merge conflicts in a Git repository?
- How can I add a blank directory to a Git repository?
- How do I list all of the files in a commit?
- Modified files in a git branch are spilling over into another branch
- Track all remote git branches as local branches
- Git keeps prompting me for a password
- Two git repositories in one directory?
- Create a submodule repository from a folder and keep its git commit history
- Remove file from git repository (history)
- How to commit my current changes to a different branch in Git [duplicate]
- git log and show on a bare repo
- Is it possible to alias a branch in Git?
- git encrypt/decrypt remote repository files while push/pull
- Branching: different config files for release/development
- How does Git track history during a refactoring?
- override git config –system in .gitconfig user file ( git config –global )
- Could not open a connection to your authentication agent
- Update Git branches from master
- git: “Updates were rejected because the tip of your current branch is behind..” but how to see differences?
- go get results in ‘terminal prompts disabled’ error for github private repo
- Listing each branch and its last revision’s date in Git
- Git pretty format colors
- How to show Git log history (i.e., all the related commits) for a sub directory of a Git repository
- Get all files that have been modified in git branch
- Git: Set local user.name and user.email different for each repo
- Git on Bitbucket: Always asked for password, even after uploading my public SSH key
- Why call git branch –unset-upstream to fixup?
- How to set up git over http?
- Git diff says subproject is dirty
- Is it possible to set a git commit to have a timestamp prior to 1970?