Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,482
Community Members
 
Community Events
168
Community Groups

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

Trent

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events