简体   繁体   中英

Not able to commit using Git Source Control Provider for visual studio

I am very new to the GIT world and most of the concept is alien to me. I followed instructions here http://gitscc.codeplex.com/wikipage?title=Installation&referringTitle=Documentation and installed "Git Source Control Provider" with vs 2010. Git Extension and TortoiseGit has also been installed as I saw it in the doc.

I followed other instructions and tried to create repo and perform some commit. I even tried to push as I read somewhere that commit is a local action. But none of this is getting reflected on server ie my GitHub account, in-fact it could not even create repo and I had to do it manually at my GitHub account. I think following two things could be a problem.

  • I remember the Git Source Control Provider installation did not ask for my GitHub credential nor do I see any place where I can specify it. I am not sure, could this be a problem? If yes, where to specify the credential?
  • I tried to push, using HTTP url to my repo but that was taking some very huge amount of time (just 1.5 MB). So I thought maybe it will not work and cancelled the process.

It is quite possible problem could be something other than the two points I have mentioned above. In any case, can someone help with some insight into the problem? Would really appreciate it.

Thanks in advance!

I would highly recommend using Git from the command line and forget about the VisualStudio integration. I've been working this way since 2008. VisualStudio integration is over-rated.

The command line will give you

  • searchable history of commands that you issued before (even between sessions)
  • tab complete for branch names, file names, etc
  • scriptability
  • output piping so you can combine commands by the output of the predecessor

When you use visual studio integration tools or other gui tools, you lose all these great advantages that git provides.

MSysGit is very easy to get started with. Just make sure when you're installing it to set line endings to not be changes when storing files and when retrieving them (unless you are doing work with others on other operating systems). If you missed out on that, you can change them after with

git config --global core.autocrlf false

Also tell git that you're on windows which has it's own line endings. You don't want them to be highlighted as problematic in certain output:

git config --system core.whitespace cr-at-eol

For your credentials issues, set up a project using the instructions here . The ssh keys setup is key and should work for you if you do what it says.

When following the instructions for installing msysgit, remember to change the line endings option to be the bottom choice.

you can ping me on gtalk if you have issues. (same as my id)

Please follow the GitHub documentation for the first steps if you are a git beginner. The documentation for the plugin is not really helpful if you are new to git. Or check out GitHub for Windows as an alternative.

You have to "link" your local repository with the one at GitHub by adding it as "remote" with git remote add origin git@github.com:username/repo.git . How should the local git know that you want to push to GitHub? GitHub is not directly related to git, it is only a hoster for git repositories.

Edit : You always have to create a repository at GitHub. The common workflow is:

  1. Create a repo at GH
  2. Clone it local
  3. Make changes locally
  4. Commit and push them

In this scenario you don't have to add the "origin" because it is automatically added while cloning it.

I found this post amazingly helpful, http://codeasp.net/blogs/vivek_iit/microsoft-net/1881/how-to-user-github-with-visual-studio .

It explains the whole process clearly. Apart the local repo setting I also had problem with SSH key. This post help me get over with all problems. Now everything is smooth.

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