Visual Studio 2013 Github commit deadlock

前端 未结 11 1923
花落未央
花落未央 2021-02-05 01:23

A few friends and I are working on a project via GitHub. We are all sharing the same branch, which may or may not be a good idea.

I edited some of the code and committed

相关标签:
11条回答
  • 2021-02-05 01:42

    Right now you are trying to essentially do a git merge with uncommited changes in your branch (pull is just fetch + merge). Git is rightfully complaining that such an operation would overwrite the uncommited changes in the branch.

    To proceed with the pull operation you need to remove this uncommited changes from the working directory. There are a couple of ways to do this

    1. commit them to your local repository
    2. stash them, run the pull operation, and then unstash them on top of the pull
    3. commit, fetch, rebase and then merge

    If you are new to git I would probably start with option #1.

    0 讨论(0)
  • 2021-02-05 01:43

    I had to download the command line tools and it allowed me to checkout the master branch there (Which also checked it out in VS). I then did a git pull which then brought up additional errors due to conflicts with the merge of the remote and local branches. Fixed the conflicts, committed, and then synced which solved this problem.

    http://blogs.msdn.com/b/visualstudioalm/archive/2013/03/08/use-the-git-command-prompt-to-supplement-visual-studio.aspx

    0 讨论(0)
  • 2021-02-05 01:43

    Running this from command line "git merge {branch name}", yielded a more specific error. "Merge conflict in .gitignore"

    0 讨论(0)
  • 2021-02-05 01:44

    I had to run git add-in in VS 2013 without solution loaded.

    My problem was that VS started application.vshost.exe when loaded windows application project, and hence blocked git add-in to perform some operations.

    Already used .gitignore from VS studio template, but that is something different.

    0 讨论(0)
  • 2021-02-05 01:48

    I had a similar issue for a new MVC project I created and for any new branch on merge it gives an error which I don't have a project I created a month ago. I added the .gitattribute file from the nice working project to the project with the error mentioned above and it fixed the issue. Now I am able to merge without any issue.

    I simply added the .gitignore to the master and commit it.

    0 讨论(0)
  • 2021-02-05 01:50

    As dumb as it sounds, I just went to the command line, and it worked.

    1. Git status
    2. Git pull
    3. Git push

    all worked fine.

    If I did that same thing within Visual Studio, it didn't work. Go figure.

    0 讨论(0)
提交回复
热议问题