简体   繁体   中英

Can not commit to local repository after making changes ( Visual Studio 2015 (Community) )

I've created a local repository in place of my solution, created a remote repository in github , made a commit, then pushed the commit to github remote repo. Ok, good. After that I've done some changes to the code and wanted to send them to github, So first I should find a commit button to commit changes to the local repo, after that i suspect i need to push this to remote. But I can not find a commit button. Instead in the Source Control submenu in solution explorer right-click menu I can only see View history,Compare with unmodified(greyed out) and Annotate No commit.

If i go to team menu and go to changes, there is a commit button there with a textfield to write down the commit message, but this button is disabled even if i put a message. Can anyone clear this out for me? Thanks

Answering the first request below I've typed git status in the command prompt and here is what i've got

D:\Projects\AsmParser>git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   AsmOperand.cpp
        modified:   AsmOperandParser.cpp
        modified:   AsmOperandParser.h
        modified:   AsmOperandParserUnitTest.cpp
        modified:   AsmOperandUnitTest.cpp
        modified:   AsmRegisterUnitTest.cpp
        modified:   main.cpp

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        AsmParser.VC.opendb
        AsmParser.rar

no changes added to commit (use "git add" and/or "git commit -a")

I guess I can do all the dirty job with command line. I'm still interested about Visual Studio problem

It seems to me that you're missing the Add step. I haven't used Visual Studio source control integration features, but there must be a way of indicating you want to record the changes before you can actually commit something.

Try typing git add -u from the command prompt (to add all modified files, but not new ones) and check if you are then able to commit from Visual Studio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM