You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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:
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.