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

Staging in shared submodule deletes file

Heyho,

I set up a shared submodule, and whenever I stage a file in Sourcetree it shows that all files contents are deleted, so effectively Sourcetree states that I am staging a deleted file. When I unstage, the file is deleted. When I add the file via the terminal, it all works flawlessly. I think the tricky thing here is the shared submodule part, with which Sourcetree has trouble. While it could be that I am doing something wrong, I have the belief that Sourcetree is doing more than a simple 'git add' (as that works from the command line).

I set up the shared submodule as followed:

1. Clone the project that should serve as the shared submodule locally to some directory
2. In the shared submodule, modify the local config of this project by adding 'worktree = ..' under [core]

For all projects sharing this submodule:

3. Add the submodule (this means, effectively I now have two checked out copies of that project)
4. Delete the respective submodule folder in ./git/submodule/
5. Delete the content of the submodule directory apart from the .git file
6. Modify the .git in the submodule directory to point to the path of the project setup in 1)

 

1 answer

0 votes
minnsey Atlassian Team Apr 08, 2019

Hi

I think you summary is probably correct, we certainly don't test such a shared submodule setup.

Can I ask why you do it like this rather than having the submodule available via a remote and each parent project simply adding it as a standard submodule from that remote? 

Sure, that is because I do not want to have several different copies checked out. This facilitates working across projects. If I'd use the standard way, if I change a file in a submodule in one project, the file would not be changed in the respective submodule in all other projects. I would have to commit it first, and then pull in all my other projects. With a shared submodule, I change a file in one project, and the changes are 'automatically' applied to all projects sharing this same submodule.

 

I see that I posted this under questions, but I forgot to ask one. So here it is: Given my setup above and the problem I run into, is this a bug in Sourcetree?

minnsey Atlassian Team Apr 09, 2019

Possibly ;) Could you raise a ticket at https://jira.atlassian.com? Thanks

Suggest an answer

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

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,907 views 0 12
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