Showing posts with label Command Line. Show all posts
Showing posts with label Command Line. Show all posts

Thursday, April 23, 2015

How to Link a Git Folder with an Existing Heroku App


  1. Follow this guide to get Heroku setup on your command line tool of choice.
  2. heroku git:remote -a project_name

where project name is the name of your Heroku app (if your app's URL is stellablog.herokuapp.com, project_name would be stellablog) and you're done! Your local Git folder will be linked with your Heroku app, and you can deploy your latest code to it.

Monday, April 20, 2015

How to Push a Local Branch to a Separate Remote Branch

This is my first post about Git! I'll be talking about how to push the contents of a local branch to a remote branch that is different from what it currently points to. The base syntax is

git push remote local_branch:remote_branch

An example of when to use this is in combination with Heroku. You might want to push your local branch to Heroku's master branch:

git push heroku foo_branch:master

That is also how you make Heroku run a non-master git branch.

Maybe you want to push the contents of your current branch to another branch on git:

git push origin foo_branch:bar_branch

Thursday, March 12, 2015

How to Kill an "open" Rails Server

If you've force-closed your Rails server instance for whatever reason (like a bug that froze up the server), you might run into issues when you try and restart it. For example, you might get the error "WARN TCPServer Error: Address already in use - bind(2) Exiting" What do you do?

Assuming that you're running on port 3000, find the PID of the process with

lsof -wni tcp:3000

and kill the process with

kill -9 PID