0

I have just set up GIT source control inside Visual Studio which loads a solution in a folder linked to my GIT repository on BitBucket.

Im still getting my head around this and wondered if anyone could shine some light on a few questions:

  • When I change a file in VS2010 it appears as you would expect in the "GIT Pending changes" window. When I click "Commit" on here with a comment, am I right in thinking that these changes will be committed to my local version of the repository until I use "Push".

  • If this is the case, can I then UNDO commits before I run PUSH? Seems silly not to run push automatically otherwise.

  • When I undo a files change "Undo pending change for file", it still remains in the list as "Modified" despite being identical to the server version in a compare. WIll it still overwrite it with the same file??! Or is this just a bug in VS2010 plugin?

Thanks for anybody that could help, I really want to try to wrap my head around GIT for my next projects' SCM!

JustAnotherDeveloper
  • 3,167
  • 11
  • 37
  • 68

2 Answers2

4

You are correct, git commit simply commits changes to your local repository, while git push sends changes to a remote repository. You're free to use git to track changes in a local directory without ever linking it to a remote repository. This is one reason why I like git and other distribution version control systems.

You can certainly undo commits in your local repository before pushing it to a remote repository. This chapter of the git book discusses this topic in more detail.

larsks
  • 277,717
  • 41
  • 399
  • 399
1

This answer https://stackoverflow.com/a/2745097/1073300 have a link to a nice picture explaining git data transport commands, including git commit and git push.

Community
  • 1
  • 1
Pierre Mage
  • 2,250
  • 1
  • 15
  • 20