Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Push the code change from a sub tree to another repoistory

Saad ur Rehman Mohsin April 8, 2020

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 Champion
April 8, 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

Saad ur Rehman Mohsin May 20, 2020

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

Saad ur Rehman Mohsin May 20, 2020

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 Champion
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
AUG Leaders

Atlassian Community Events