简体   繁体   中英

How to push or upload projects from different folders in one Solution to Github in visual studio 2019?

I have a Solution with original project: Lab_01_ConsoleAppMike. Then in the Solution I added another existing project from different folder: Form_Lab_Mike. And I pushed the Solution to the Github . It just pushed just one project: Lab_01_ConsoleAppMike that located in original project folder. The other project from different folder: Form_Lab_Mike did not load to git.

My question is: How to push or upload projects from different folders in one Solution to Github in visual studio 2019?

Here some photos of this problem: Github Did not load Form_Lab_Mike to the Github

git repository handles files that are located in the same folder (like solution root)

Please ensure that both projects Lab_01_ConsoleAppMike and Form_Lab_Mike are in the one folder and add the Form_Lab_Mike using git add Form_Lab_Mike command.

There is an submodule git feature that can reference to another repository and have files from another repository. However this may work if you have Form_Lab_Mike project uploaded to git hosting already.

You may add submodule using git submodule add <repositoryurl> if you have Form_Lab_Mike hosted by git already.

Yes, Thank you oleksa, moving the other project to the original project's folder and changing the path for the second project helped.

Here is how I did it:

  1. Copy the second project folder to the original project's folder:

second project and copy to original project's folder

  1. Add existing Item. Choose the second project folder that is already in original project's folder.

Add existing Item

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