Quick note on starting up new projects.
I use ssh identities to manage the ssh key pairs for pushing things up to bitbucket. Thus I only have to set up the key pair for a particular project once and then every subsequent time I push i just do git push This is super common, I’m not bragging. But, because I only do this once per project and I’m still new enough that I’m not starting projects all the time, I frequently forget the exact steps to set things up.
First off, make sure you’re using the right version of Ruby etc. My system is very particular because I have some configuration headaches that I just haven’t had the time and wherewithal to cure yet. So, for me, it’s important to run rvm use system right before I start my new project. This tells rvm to use the ‘system’ versions of Ruby and Rails (which on my system is the one that’s headache-free). You might use rbenv or some other system, but just do a little up-front checking to avoid configuration hell.
Next, generate that new project. Super simple rails g new project_name Check the rails guides if you need any help there.
Now, even before running any sort of scaffolding, you should initialize git and set up the remote repository.
git init ##always makes me think “gettin’ it!”
git add -A
git commit -m “initialize project” ## Feel free to change the message if you like.
Here’s where we need to set up the remote repository, which I do through the bitbucket website interface. Log in at BitBucket.org. Navigate to Repositories > create repository. Give it a name and hit create.
I have a single key that I use for most things. This will likely change when I have more serious projects, but for now I just use that one. If you haven’t done so yet, add yourself an SSH key. these instructions might help.
With the SSH key set up ahead of time, you still need to tell the ssh agent to use that key. Do ssh-add -l. If your key is somehow there already then you’re good to go. if not, do ssh-add ~/.ssh/your_id where “your_id” stands for the SSH identity you want to use.
If that all works with no errors, we’re almost there. BitBucket suggests this sequence of commands for the initial push:
cd /path/to/my/repo
git remote add [email protected]:JDenman6/delete_me.git
git push -u origin --all # pushes up the repo and its refs for the first time`
git push -u origin --tags # pushes up any tags
And that’s that. You’re ready to start scaffolding out your project. :)









