Tuesday, December 4, 2012

Using Github for Windows

I have started using the Github Windows GUI for using git on Windows, and so far I am very impressed. Github has made it very easy to download (clone) an entire directory tree of code files to a new computer, something I have to do more often that I would like. Git is an incredibly powerful tool for version control, and I really do not scratch the surface of its functionality. An important thing to remember for a novice user is that it is best to make sure you are working with the newest version of the repository before you start making edits on any given computer. Otherwise merging the edits from different computers (or users) can be hard. This can be accomplished by opening the github GUI before editing any files and clicking 'sync.'

Note: If, when setting up your repository, you accidentally included files that you did not want to have git follow, you can use this command:
git rm --cached <filename> 
by going to tools>open a shell here in the github GUI. You may also have to include a new line in your .gitignore file...

When you inevitably (in my experience) get an error message along the lines of "failed to sync this branch" with options to "open shell to debug" or "cancel," choose the former, and typing
git push
git pull 
depending on if you are trying to upload (push) or download (pull) changes from github.com will sometimes work.


Alexander Johnson said...

Here from a Google search (and Seattle!) to provide confirmation on the inevitability of Github client error messages. I'm half convinced that it was written by frothing at the mouth Unix geeks to fail on purpose in order to force you into using the command line. ;)

Peter Weir said...

Yeah, git can be quite a headache, and the github for windows GUI looks pretty new, so let's hope it gets increasingly functional as time goes on...