Roger_S
Roger_S

Reputation: 529

Using Bitbucket, how do I get commits from one branch into another?

At my new job, where we use git with Bitbucket, we have a master branch, a new-features branch and a fix-these branch.

I've been making all my changes to the fix-these branch. After committing them, I push them to origin/fix-these using SourceTree. So far, so good.

In Bitbucket, how do I make the fix-these branch so that it includes the few commits that have been made recently to new-features? (And then I just "pull origin/fix-these" to make my local copy current, right?)

Upvotes: 14

Views: 43288

Answers (3)

Karsten Sperling Opdal
Karsten Sperling Opdal

Reputation: 101

You cant, you'll have to use git commands. Would have been nice with a web interface for it like pull requests.

Upvotes: 6

Erik van Zijst
Erik van Zijst

Reputation: 2331

As Tim suggested, you'll want to merge new-features into fix-these.

You can do this on Bitbucket by navigating to the Compare page (see sidebar), selecting "fix-these" as destination, "new-features" as source and then hitting the Merge button in the top-right corner.

Upvotes: 2

Ankit
Ankit

Reputation: 249

Use git cherry pick. It lets you pick commit and add them over other branches.

git cherry-pick <commit> 

Example:

git cherry-pick 123456

This will add the commit on the current branch.

Upvotes: 23

Related Questions