This post lists commands that are used regularly in the tools' CLIs a web developer uses on a daily basis (Git, Heroku CLI,...). Come back to this page anytime you forgot a command.

For Code Snippets instead, read this post.

Git

Create a new repository on the command line

echo "# App name" >> README.md 
git init git add README.md 
git commit -m "first commit" 
git branch -M main 
git remote add origin https://github.com/<account_name>/<repository_name>.git

Push an existing repository from the command line 

git remote add origin https://github.com/<account_name>/<repository_name>.git 
git branch -M main 
git push -u origin main

Add or Update a Remote

# List all remotes
git remote -v 

# Add a remote:
# eg. `git remote add github https://github.com/edouardproust/portfolio.git`
# eg. `git remote add gitlab https://gitlab.com/solo-projects/portfolio.git`
git remote add <remote_name> <remote_url>

# Update remote:
# eg. `git remote set-url github https://github.com/edouardproust/portfolio-v2.git`
git remote set-url <remote_name> <remote_url>

Flask

Activate Debug Mode

export FLASK_DEBUG=1
flask run

Heroku

Create a new App

The app name must be unique among the Heroku public directory.

heroku create app_name

Add or Update a Remote

# Add or update a remote:
# eg. heroku git:remote -a portfolio-edouardproust
heroku git:remote -a <app_name>
⇐ Python: Create and Import...Python: Deploy a Cron job on... ⇒
Image
Author of this website. I am passionate about programming and web design since the age of 12. After a stint in architecture and entrepreneurship, I came back to my original passion at 30 years old and became a self-taught web developer in less than 2 years.

Leave a Comment