Skip to content

Instantly share code, notes, and snippets.

@SlappyAUS
Last active October 17, 2020 09:11
Show Gist options
  • Select an option

  • Save SlappyAUS/9e7322906b728d830caa382d557c4777 to your computer and use it in GitHub Desktop.

Select an option

Save SlappyAUS/9e7322906b728d830caa382d557c4777 to your computer and use it in GitHub Desktop.
Git Cheat Sheet #cheatsheet

GIT Cheatsheet

git init
git status
git add [filename]			(add to staging area)
git add -A					(add all to staging)
git reset [filename]			(remove from staging)
git commit -m “message”		(commit from staging)
git commit -a -m “message”	(stage and commit)
git clone <url> <where to clone>
git remote -v				(information on remotes)
git branch -a				(branch information)
git diff					(show changes)

git pull origin mater			(Pull to update before push)
git push origin master		(push to origin)

Workflow for New Feature

git branch <feature name>	(Create a new branch for feature)
git checkout <feature name>	(checkout the branch)

Make changes

git status
git add -A
git commit -m “message”

After feature complete

git push -u origin <feature name>

Merge with master

git checkout master			(switch to master)
git pull origin master			(update any changes made remotely)
git branch —merged			(list branches already merged)
git merge <feature name>	(merge current with specified)
git push origin master		(push to remote)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment