3

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

4
  • 1
    ...assuming this is Visual Studio? Any plugins involved? Commented Jun 14, 2013 at 10:38
  • 1
    Am I understaning properly? 1. user1: commit Class1 2. user1: push to shared repository 3. user2: pull from shared repository 4. user2: can't see Class1 Is this what you meant? Commented Jun 14, 2013 at 10:42
  • @user1615903: no plugins Commented Jun 14, 2013 at 10:45
  • @jdsumsion: class file already committed Commented Jun 14, 2013 at 10:46

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.