Is there any way to add a folder to git source control(Like "Add to source control" option for TFVC) from visual studio.
Asked
Active
Viewed 4,056 times
1 Answers
1
If the folder has files, and those are included in your project, then you could commit them in the team explorer. (Tab changes)
Please note that Git doesn't track empty folders. If you need a folder without files, check How can I add an empty directory to a Git repository?
Update, for files that should not be compiled etc, you could set "build action" to "none" for those files.
Update 2: if you need those files in Git but not in your project, you need something next to Visual Studio I'm afraid. I could recommend Tortoise Git (https://tortoisegit.org/) for Windows users.
(Or maybe there is a Visual Studio plugin for this)

Julian
- 33,915
- 22
- 119
- 174
-
Then follow https://stackoverflow.com/questions/115983/how-can-i-add-an-empty-directory-to-a-git-repository – Julian Sep 28 '19 at 06:18
-
The screenshot attached in your answer is for TFVC source control, right? – rinesh Sep 28 '19 at 06:24
-
Why can't the files be included in the project then? – Julian Sep 28 '19 at 06:24
-
About the screenshot, indeed. I will update it. Update: fixed – Julian Sep 28 '19 at 06:25
-
Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/200086/discussion-between-julian-and-rinesh). – Julian Sep 28 '19 at 06:36