Skip to content

NatuMyers/git-cheatsheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 

Repository files navigation

Git Cheatsheet

Initial

Makes current directory a git repo (after you make a git repo on github.com first!)

git init 
git add .
git commit -m "init"
git remote add origin URLHERE
git push -u origin master

Post Initial Push (same minus git init)


git add .; git commit -m "update"; git remote add origin URLHERE; git push -u origin master

Make a branch


git checkout -b [name_of_your_new_branch]
git push origin [name_of_your_new_branch]

Delete branch both locally and remotely

git branch -D branch-name
git push origin --delete branch-name

Merge branch without merge commit

git checkout master
git checkout -b feature/foo

# make some commits

git rebase master
git checkout master
git merge --ff-only feature/foo

Source

List remote branches

git branch -r 

Heroku Django database migrations

git add .; git commit -m "the message"; git push heroku master; git push origin master; heroku run python manage.py makemigrations; heroku run python manage.py migrate --run-syncdb

migrate offline then

heroku run python manage.py makemigrations; heroku run python manage.py migrate --run-syncdb

push to fork:

git add .; git commit -m "fork message"; git push forked master;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published