Skip to content

Instantly share code, notes, and snippets.

@overdrivemachines
Last active July 27, 2022 07:17
Show Gist options
  • Save overdrivemachines/e7c36ceab1260e7d34d37e24a1a4a51e to your computer and use it in GitHub Desktop.
Save overdrivemachines/e7c36ceab1260e7d34d37e24a1a4a51e to your computer and use it in GitHub Desktop.
Github Cheatsheet

Github Cheatsheet

# First time setup
$ cd hello_app
$ git init
$ git add -A
$ git commit -m "Initial commit"
$ git remote add origin https://github.com/overdrivemachines/hello_app.git
$ git branch -M main
$ git push -u origin main

# List of Commit Messages
$ git log

# Create and Switch to New Branch
$ git checkout -b modify-Alpha

# List all Branches
$ git branch

# Switch to Main Branch
$ git checkout main

# Merge Branch to Main Branch
$ git merge modify-Alpha

# Delete Branch
$ git branch -d modify-Alpha

# Delete Branch that was not merged
$ git branch -D modify-Alpha

=================

After we are done with a branch

$ rails test
$ git add -A
$ git commit -m "Add user following"
$ git checkout main
$ git merge following-users
$ git push
$ git push heroku
$ heroku pg:reset DATABASE
$ heroku run rails db:migrate
$ heroku run rails db:seed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment