0

From Visual Studio 2013 I click the "Open Command Prompt".

Then "git add myfile.txt" - success is confirmed by a "git status" which indicates "new file".

But then, back in Visual Studio 2013, the file is still in the "Excluded Changes". I've edited the file to trigger a change event. I did a "refresh", I even closed Visual Studio 2013, reopened fresh. Still nothing..

Am I missing something?

1 Answer 1

1

Right click on the file in the Solution Explorer in Visual Studio and select Include In Project.

It is a separate process that git add.

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

3 Comments

Thank you, yes I know it can be done from withing Visual Studio, but since it is acting on the same GIT repository, I was expecting that actions on one side (here the command prompt), would be seen on the other side (Visual Studio). And this is the case for a Bash GIT "push" and "commit", Visual Studio automatically refreshes the "Team Explorer" almost instantly: Changes and Commit disappear. But not for "Git add". This one leaves Visual Studio cold. I think it's because VS refreshes based on constant checking of the bitbucket origin state, but not local checks of possible Bash Git actions.
But this is no big deal, I was just curious as why it was not followed by any effect in VS. I've got an official "git add" from the command-prompt or Bash Git, yet Visual Studio doesn't reflect anything.
For git add you are adding files to the git repository. When you are Include A File in Visual Studio, that is adding the file to the Visual Studio project. They are completely different. Git is used for source control and versioning while the Visual Studio project is used for building the application and deployment.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.