As part of this process all of the developers needed to get setup with the tooling in Windows necessary to interact with the new repository that’s on our domain. Most of the documentation that I was able to find for GitHub was specific to setting up the tools for GitHub proper and not for the Enterprise version, so I created this quick start guide for developers looking to get setup to work with local versions of GitHub.
Sign In
Visit the URL for your local GitHub installation and sign in (upper right corner). If you have set it up for Windows Integrated authentication then you would use your domain user account and password.
Setup your profile
Click the account settings icon in the upper right corner.
Provide your name, email, website url, location, and Gravatar so your picture shows on your commits.
Download GitHub for Windows
Click step 1. SetUp Git
Then download and install GitHub for Windows
When it asks for your github.com user name and password, just skip to the next step and continue the installation (unless you would also like to integrate with github.com). Then close github for windows. This just installed all the local tools you will need to work with Git.
To the console and beyond!
Open up the git console. There should now be an icon for Git Shell on your desktop.
Create a folder to hold your git repos and go to that folder:
cd \
md git
cd git
Set your config options
git config --global user.name "YourUserName"
git config --global user.email YourEmail@YourCompany
git config --global merge.tool kdiff3
Obviously these should be your username and e-mail.
Clone the repo you want
You can find the full path to the repo you want by going to the repository page in the github site. You can do this by navigating to your Enterprise installation and clicking Explore in the top bar. Hopefully you can find the repo you want in the list.
Now that you know where your repo is located, clone it locally with the shell. Important safety tip: Repository names are case sensitive.
git clone http://yourlocalgitrepo.company.com/Organization/Repo.git .\Repo
Now you’re in business!
Frequently used git commands
Hopefully these seem familiar.
git status
git commit -m "my message"
git pull
git push
When you push you will be prompted for your user name and password.
Visual Studio Integration
Visual Studio now provides built-in integration with Git. VS 2013 preview is smart enough to know that it is working with a git repo, has the git plugin, and automatically sets up this integration. VS 2012 requires that you set the source control provider:
- Download the Git Provider Plugin and install it.
- Go to tools -> options -> Source Control and set the provider to Git
Now you have icons next to all the files indicating their status and you can use team explorer (next to solution explorer) to perform common git tasks.
Enjoy!