0

So I have an existing git repo full of c code. I want to compile that c code into a .dll, and then add a c# solution utilizing the dll and commit and push the updated code to git so that others can pull and build the solution without having to bother with building the dll themselves.

However I am not very familiar with visual studio at all, and am use to the control of working in vsc or vim. The approach I tried was to clone the c repo to a local folder, then open that folder with visual studio, compile the c code and add my solution / project files, then use visual studios commit feature to commit the changes and push them to origin.

However, this did not update the .gitignore, so this pushed every single file in the solution. I am not sure what is necessary so that others can build the solution and what is unnecessary or may even break the solution on another person's machine, since I see config, cache, and db files with my paths included in the commit.

I could edit the .gitignore manually, but again, I don't know what is or is not necessary, and I have to imagine there is a way to automatically do this in visual studio that I am just missing.

Is there a proper workflow I should be using to clone a git repo and add a dll and a c# solution in visual studio?

  • 1
    I feel like this all boils down to you updating your .gitignore properly, and then redoing your process. [This question](https://stackoverflow.com/q/2143956/184546) may be a good place to start. – TTT Jul 13 '22 at 21:30
  • Ok thanks. I had a feeling that might be the case, but this seemed like something I would expected Visual Studio's version control to take care of behind the scenes rather than something I would need to update manually – user19435638 Jul 14 '22 at 13:24
  • 1
    Agreed, and in fact you can use the UI to create the gitignore for you. So IMO this is probably a dup: [.gitignore for Visual Studio Projects and Solutions](https://stackoverflow.com/questions/2143956/gitignore-for-visual-studio-projects-and-solutions) And I have just edited one of the existing answers that works in your [case when you already have a .gitignore file](https://stackoverflow.com/a/66813739/184546). – TTT Jul 14 '22 at 18:45

0 Answers0