• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 3.2.2
    • Git
    • None
    • Severity 3 - Minor

      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)

       

      (reason for shared submodule is that we have the same code base across different projects, and this way I can change a file in the code base once and it is applied to all projects without having to pull their respective submodule first)

            [SRCTREEWIN-13132] Staging in a shared submodule leads to deletion of files

            Horschig added a comment -

            Horschig added a comment - See also  https://community.atlassian.com/t5/Sourcetree-questions/Staging-in-shared-submodule-deletes-file/qaq-p/1046179

              Unassigned Unassigned
              40b695fbdae3 Horschig
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated: