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. :)












