Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Want to refresh/copy Sandbox branch from Production branch

Hi Guys,

I'm sure it's a simple thing but just can't seem to work out how to refresh/copy with overwrite to a remote server using GIT, SourceTree and Pipelines.

I have a Production branch and also a Sandbox branch in SourceTree both using Pipelines to deploy to remote servers on AWS. I would like to ‘refresh’ the Sandbox branch from the Production branch and therefore make a complete copy of the Production server on the Sandbox (or at least copy all the code but without the history).

I have tried a few times using SourceTree with merging and rebasing options but am always ending up with a merged result rather than a fresh copy of the Production branch.

I would like to know if the ‘refresh/copy’ of the Production branch would be possible from within SourceTree or do I need to create a new GIT repo in BitBucket and migrate the Production branch into there and rename it Sandbox?

Also, I’m not sure if there are any options/config available in BitBucket to achieve the refresh/complete copy of the branch.

So far I have used the following approach:

  1. Copy the Production branch to my local dev system
  2. Merge the new branch into the local Sandbox branch and push to remote

This result is a merged branch and not a copy of Production. I also tried deleting the local copy of Sandbox but that did not let me push to remote as it is now misaligned with the ‘HEAD’.

I also tried rebasing but that gave the same error as above when I tried to push the changes to the remote Sandbox.

For the push, I have changed the deployment command in the pipelines.yml to ‘git init’ and have tried removing the git log file as well as all the directories to ensure the full content of the local branch is deployed but this still gave a merged Sandbox/Production result.

Kind Regards



0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

5,738 views 4 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you