Can I have one repository for several different local position

Hello,

On Bitbucket I have multiple repositories, one of them is a general one (like a library)

I have multiple projects that are using this same repository. For the moment each project have different sourcetree repository linked to the same repository on Bitbucket and I would like to know if it's possible to make only one sourcetree repository for multiple different location on my computer

For example :

I have 3 projects call them A, B & C
On Bitbucket I have 5 repositories call them (AA, BB, CC, DD, General)

What I have is

Project A need AA, BB & General
Project B need CC & General
Project C need DD & General 

 

I would like to know if in sourcetree I can make only 1 repository that is linked to the 3 projects in 3 different places or if only can use one location and I have to make 3 sourcetree repositories for each projects

Thanks for your answers.

2 answers

I don't know much about it, but git subtrees may be what you're looking for. 

https://medium.com/@porteneuve/mastering-git-subtrees-943d29a798ec#.tnycb0h3o

You would still have multiple copies of the General code on your machine, but managing them would be unified with whatever repository they are embedded in.

 

For a non-git, non-sourcetree answer, you can probably just use symbolic links:

https://gigaom.com/2011/04/27/how-to-create-and-use-symlinks-on-a-mac/

http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

I prefer submodules since they behave a bit more like SVN externals. Managing them would not be unified/embedded with the history each of your individual project repositories.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 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...

696 views 3 2
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you