Skip to content

Instantly share code, notes, and snippets.

@zrosenbauer
Last active August 29, 2015 14:01
Show Gist options
  • Save zrosenbauer/b98d4406e360953f415d to your computer and use it in GitHub Desktop.
Save zrosenbauer/b98d4406e360953f415d to your computer and use it in GitHub Desktop.
Git Basic Commands

Git Commands

Just wanted to thank Parker Cameron for putting 95% of this together. We will keep adding to this file as need be. Any suggestions email us: [email protected]

~ The PointStart Crew

Simple Commands/Actions

###Create a new repository on the command line

touch README.md

git init

git add README.md

git commit -m "first commit"

git remote add origin https://github.com/(User Name)/(Name of  Repo).git

git push -u origin master

Push an existing repository from the command line

git remote add origin https://github.com/zrosenbauer/IOBrewWebPage.git

git push -u origin master

Cloning

$ git clone

$ git branch (YourBranchName)

$ git checkout (YourBranchName)

Committing

$ git add --all

$ git commit -m 'Commit message'

Uploading to GitHub

$ git push origin (YourBranchName)

Merging (from Dev branch)

$ git checkout master

$ git branch -d (YourBranchName)

$ git checkout -b (YourBranchName)

Merging (to Dev branch)

$ git checkout master

$ git merge (YourBranchName)

Make sure to resolve any conflicts

Uploading to GitHub after a Merge (to Dev branch)

$ git push origin master

Uploading to GitHub after a Merge (from Dev branch)

$ git push origin (YourBranchName)

$ git push origin (YourBranchName)
@dubpred
Copy link

dubpred commented Aug 24, 2014

What about git pull?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment