Using Visual Studio and Git. How to commit a new folder to the Git repository


all. I am very, very new to Git. Places I've worked at usually use TFS, and I want to learn some Git.

I don't even know if I have it set up correctly, but I do have the VS2017 Git Add-on. I've committed some code, and a project. The problem is, I added a couple of folders to my project, but I can't figure out how to check them into my repository. Nor can I figure out how to check in the DLLs that are in the project.

I'm very, very new to Git, so how would I do something like this? I've tried right-clicking on the folder, and looking for some sort of option to add it, so that I can check it in, but I haven't been successful finding anything.

Best Answer

To add a file/folder, use git add command. Then use git commit to commit to your local repository. If you want to send it to the base (to be available to other users, for instance), you should git push your changes.

Remember to, before adding the files, to create a .gitignore file in order to avoid persisting binaries and auto-generated things (dlls, exe, etc) - these shouldn't be on repository.

Maybe you should search for some tutorials, documentations. Maybe this would help you improve your knowledge on git.