rahul
rahul

Reputation: 187050

Automatically include newly added files when pulling from GIT

User 1: creates a new class and commit and push that to git.

User 2: does a git pull. newly created class file gets downloaded but not included in project. Has to right click and do "Include in project"

Is there a way to automatically include a newly added file while doing pull from git?

Do I need to commit any other file (.csproj/.sln) to solve this issue?

IDE: Visual Studio 2010

Upvotes: 3

Views: 448

Answers (1)

Andy
Andy

Reputation: 46404

The project files, .csproj, keep track of which files are loaded in a project. So yes, you will also need to commit the updated project file to the repository in order for User 2 to have the file added to their project as well.

In my experience, even if Visual Studio is open, it will recognize the changed project file and ask if you want to reload it. When you reload it, your project should have the new file loaded.

As an aside, there is a great blog post on why you should get fetch/merge instead of pull

Upvotes: 2

Related Questions