简体   繁体   中英

Pushing changes to sub-repository using Visual Studio 2019

I'm trying to handle two repositories ( repo B being child of repo A ) by only working on the parent repo A .

Current sub-repository handling:

当前子存储库处理

Basically, my objective is to push changes to repo B whenever I push repo A (if there are changes to repo B folder).

I tried achieving this with Submodules, but it seems vs2019 won't even recognize specific changes in the submodule folder. It will just display that the submodule has changed but never really allowing me to push. Most of the time I just get fatal: unexpected sequence in commit output .

Both my repositories are in Azure DevOps. I've also considered making a Pipeline that runs a .sh script to automatically push another repository on registered pushes. Could only get repo A trying to push the entirety of itself on repo B .

Is this really the only way to achieve what I'm trying to do? Am I doing something wrong?

Visual Studio 2019 understands that a submodule is dirty, but it does not currently have the ability to push both the parent and submodule at the same time. This is because Visual Studio currently only opens one repo at a time. In your scenario, Visual Studio is only directly working with the parent repo.

A workaround, while definitely not ideal, is to open the submodule repo directly first. Commit the changes there, and push it. Then switch back to the parent repository to consume the changes and then push the parent.

The ability to work in multiple repos has been requested by customers, and is something that will be considered for a future release.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM