So now that you've started using
Git, you might want to share your repository with your team using a
central repository. I'll show an example of how to do that by using
a free account at Unfuddle.com.
Sign up for Unfuddle and log in to your account (through
your_account_name.unfuddle.com). Go to "Repositories" and create a
new Git repository.
Now you have to create an authorization key, to be able to log
in to the Git repository remotely.

Go back to Visual Studio and click Git's "Browse repository"
(the folder icon) button again. Then in the menu go to "Remotes"
> "PuTTY" > "Generate or import key".

Make sure the settings for generating the key are correct, the
key needs to be 2048 bits.

After you've generated the key, change the key comment to your
e-mail address, and enter a passphrase for the key. Now, make sure
you copy the key from this window! Saving the
public key generates a slightly different format, but Unfuddle
really needs the format as it is in this window.
Save the public and private key somewhere anyway, you'll
especially be needing the private key later.
In Unfuddle go to "People" > and edit the Account admin. In
the bottom left you can enter a "New public key...".
When that key is accepted, go back to the "Repositories" tab and
find the repository server, under your repository title (something
like git@your_account.unfuddle.com:your_account/abr.git), copy this
address.
Now you can set up the remote server in Visual Studio. In the
menu bar, click "Git" > "Manage remotes". Give your remote
server a name (no spaces) and paste the address you just
copied.
Browse the private key that you stored earlier and choose hit
"Load SSH key". Enter the password for that key and then you can
save the connection. For some reason the "test connection" button
fails for me ("ERROR:gitosis.serve.main:Need SSH_ORIGINAL_COMMAND
in environment."), it still works though.
So now you're ready to push whatever is committed in your
current branch to the remote server, use the blue up arrow ("Push
changes to remote repository") to do so. You could also then push
all branches and tags, or do a pull first to resolve any merge
conflicts if you want.
In the next part of this series, I'll give a quick rundown of
branching and merging.
Share this post: