Adding Git to Visual Studio 2019

I am brand new to Git. We now use Visual Studio 2019 for our developing. How do I load existing COBOL projects/solution to a Git repository?

We have a startup solution utilizing 25 project that contain thousands of programs/copybooks.

I am not being very successful.

Hi @schleyer and welcome to the community :wave:

Happy to see you made your first post here!

Are you trying to upload your existing local repositories to GitHub?

You can create an empty GitHub repository and then connect to remotely from your local machine and upload your project files.

Start here:

Once the repository is created you can follow the steps under “create a new repository on the command line”

Look for the git remote add origin suggested code.

If you were looking to do something else, please give details on what you are trying to do and the expected outcome.

No, we are not trying to upload to Github. We want to keep our master repository on a different server on-site. We are not currently using a source control product. I was trying to take our current COBOL solution, which contains 22 projects (each containing many COBOL programs), and add it to Git source control.

When I open the startup solution and try adding it to source control, I get a warning message that “a Git repository cannot be automatically initialized, … that items referenced exist outside of the solution and therefore cannot be tracked by Git”.

I think this might be because the startup solution is a COBOL linked library but regardless it creates the .git , .gitattributes and .gitignore files but does not actually acknowledge any COBOL program changes.

I can’t seem to find and documentation to address my issue of adding an existing COBOL solution to Git source control.

Thanks for clarifying.
What commands have you run in order to setup git in this folder?


I am still getting nowhere with using Git. I cannot find any documentation on how to add an existing COBOL linked library solution to Git in Visual Studio 2019.

My boss is starting to look at other products.

Surely there must be some example documented somewhere or is it simply that Git doesn’t work with linked libraries.


In order to best assist you here, it will be helpful to know exactly what you have done and what doesn’t work.
What commands have you run in order to get the above result?