Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't push subtree using sourcetree

I'm looking to use git subtree to use a framework repo that I own in my project repo. This should look like this:

  • project
    • Some stuff
    • Some stuff
    • framework

Using Sourcetree app for windows I made the following:

  • Clone project
  • Add Subtree framework in a folder named framework
  • Add test.txt in framework

That leads me to something like this:

  • project
    • Some stuff
    • Some stuff
    • framework
      • test.txt

Sourcetree then tells me that test.txt is not staged for commit so I add it and commit it.

I might be using it wrong but I couldn't find a way to make sure test.txt was actually added to the framework repo and not to project/framework as it seems to be.

If I push this I got the right files in project/framework/test.txt as expected but the framework repo remains empty (it didn't receive the change I made)

I thought I had to manually push the subtree to commit these changes to framework repo but it seems to loop endlessly without giving me any error

I let this run for more than 10 minutes but didn't get any result. Any help would be very appreciated.

Thanks for your time.

like image 877
user3817301 Avatar asked Oct 20 '22 05:10

user3817301


1 Answers

Yes, you'd have to push the subtree to the remote using precisely what you were using. This is how the whole submodule/subtree approach works in general - you commit changes to your main repo but you'd have to manually push those changes up to the remote for the subtree.

We designed subtree support so you could just right click and push to the selected subtree using metadata that we store. I haven't had any reports of bugs, but that definitely looks like one. Could you report it via jira.atlassian.com including as much detail as possible, it's better handled there and I'll take a look at it then.

Cheers

like image 106
Kezzer Avatar answered Oct 24 '22 12:10

Kezzer