Ok, in the past I’ve used github, but you can’t have private repos there. You can in gitlab, but there’s no auto integration into the ‘lazy man’s’ front end to manage things graphically - at least I don’t know of one yet. I chose bitbucket as it’s free for a team of 5 or less, you can have private repos, and it integrates very nicely with SourceTree, they are both created by the same company (Atlassian), and it’s the repo Ben suggested.
So… what was my experience with it. Initially it was poor, but only because I didn’t research enough to use it properly on first use. Now that I understand it, it’s a great set up for code repositories.
How did I get it set up? I’m writing this here, as some details were not covered by the video - the video was good, but I’m a bit behind in the technology to do these things…so…
I use OSX.
I needed SourceTree, Bitbucket, an Atlassian account, and an SSH public key, in order of discovery.
Without having any of the above, the first thing to do is the last thing I discovered; SSH key.
I needed to see if I had an SSH key - it sounded familiar so I might have it already.
Where is the SSH key? In OSX, it’s:
~/.ssh/id_rsa
I did have one! But is it connected to SSH? You want to make sure SSH is using your public key.
Wait…is the SSH agent even running? Let’s check:
eval $(ssh-agent)
That should show you the process id (pid) of the running SSH agent (it usually is running)
If you need to get it running:
ssh-add -l
That will list 'fingerprints of all identities currently represented by the agent.
I didn’t see one for bitbucket. That makes sense as I don’t have bitbucket…yet.
Now I need to make sure ssh has my key:
ssh-add ~/.ssh/id_rsa
That will take care of that…wait! the last time I set up my keys, I added a passphrase to make it more secure…ok…lol…what was my passphrase again?
To find that out, open Launchpad, search for Keychain Access and open that. Looks like a set of lock keys…
When open, scroll down in the list of keychains to find the line of
SSH: /Users/[your account name]/.ssh/is_rsa
and double click that line. You will see a dialog pop up. Click the ‘Show password:’ checkbox and, after entering your administrator password, you will see the last passphrase used. DO NOT ALTER IT HERE! If you do, you’ll just have to recreate it again, and copy your public key to wherever you used it.
Now you can use your passphrase to add your key to SSH, as shown above.
Now, I need an Atlassian account - That’s pretty easy, but you will have to choose another passphrase there for other services that want to use bitbucket. Go ahead, but you won’t need that here.
Now, download and install SourceTree. Pretty easy.
Now you can follow the steps in the video BUT DO NOT USE CHARACTERS LIKE ‘+’, or any other special characters in your repository name OR description. It took me a while to figure out why it was hanging here. A wise fellow in some arcane comment on StackOverflow pointed people in the right direction here.
When I created my repo, I only used lowercase alpha characters for the name or description. I also have NO SPACES in the repo name. So my repo name was
buildingescape
and my description was
Udemy UE4 CPLUSPLUS course with first use of UE Editor
and NOT Udemy UE4 C++ course with … etc etc
NOW it all worked fine and created the local and remote repositories in Bitbucket.
I committed my code…yay…and pushed to Bitbucket… I tried to push to Bitchbucket… no joy…
I had to log into my Bitbucket account and add my public SSH key there to make sure I could connect properly… to do that:
Go back to your terminal and copy your public key but DON’T TRY TO COPY IT MANUALLY:
Do it like this:
cat ~/.ssh/id_rsa.pub | pbcopy
You will need to enter your passphrase key again. That command with copy your key to your copy buffer.
Now log into Bitbucket and Under your profile image, at the very top right, click on it to see the menu item Bitbucket Settings. Once that opens, Scroll down to see the Security section, and click on ‘SSH Keys’ Then just click on add, and paste in your public key. DO NOT ALTER any part of it and hit save.
Now logout of bitbucket, restart SourceTree, and push your committed code!
I thought I would be committed before figuring all this out, but it worked out great.
I hope this helps someone on OSX…