Create
cancel
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

Push the code change from a sub tree to another repoistory

HI,

I have 4 repositories.

  1. Master
  2. Development
  3. Modules
  4. Includes

Master is my main repository that i want to create my final release builds from.

Development is all encrypted code

Modules and includes are subtree for the development repository. I would like to complete all the development part in my development repository and then push the code of modules and includes subtree to the master repository.

Thanks in advance

1 answer

1 accepted

0 votes
Answer accepted
Mikael Sandberg Community Leader Apr 08, 2020

Hi @Saad_ur_Rehman_Mohsin,

As I mentioned in my reply yesterday to your same question, it can be done, but you have to do the merge from the command line, it cannot be done within Bitbucket (and using subtrees do not change anything). Please see my answer from yesterday, https://community.atlassian.com/t5/Bitbucket-questions/Can-we-merge-the-code-to-another-repository/qaq-p/1343138

My merge problem is solved but the folder creation or directory structure gets messed up. How can I merge a subtree into a specific folder

Like I want to merge the subtree for includes in includes folder it is not doing that it copies it on the main folder that I don't want to do that. I have a folder structure

 

php/includes/

php/modules

 

 

I have two subtrees includes

modules/

 

my main problem is that in the include repository if I update everything in the include folder and create a subtree in my project it will create like this php/includes/includes and i want it to be php/includes. In order to do that I have to copy only the files in the includes repository. Now when I am merging the repositories it is copying the whole includes file at php that I dont want I want all the data to be merged in php/includes folder

Mikael Sandberg Community Leader May 21, 2020

Subtree doesn't allow you to have your source as a folder inside another repository, the source has to be a repository.

Example:

main_repository/some_folder/my_subtree

my_subtree

my_subtree is a separate repository that has been imported as a subtree in the main_repository.

This is a good source for how subtrees works, https://www.atlassian.com/git/tutorials/git-subtree

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,886 views 0 7
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