You are on page 1of 2

5/16/13

Git Cheat Sheet - 6tech.org

Git Cheat Sheet


Date: January 22, 2013 Author: cupton

I know there are a ton out there, but I like to have all my stuff in one place with the commands I use frequently.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

# Clone Master Repo: mkdir /path/to/your/project cd /path/to/your/project git init git remote add origin https://username@bitbucket.org/group/repo.git git pull origin master # Setup Global Configs git config --global user.name "User Name" git config --global user.emal "email@email.com" # Make changes and push echo "# This is my README" >> README.md git add README.md git commit -am "First Commit. Adding a README." git push -u origin master # Push your whole folder to Master # *Note only needs to this once to setup the repo* git commit -m "Adding all files to repo" git add . <-- there is a dot at the end git push # Create Branch and Switch to it git checkout -b branchname # Switch back to Master or which branch git checkout master git checkout somebranch_I_used_before # Edit a File and Commit Changes git commit -a -m 'added a new footer [issue 53]' # Merge Branch into Master

www.6tech.org/2013/01/git-cheat-sheet/

1/5

5/16/13

Git Cheat Sheet - 6tech.org

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

git checkout master git merge branchname # Delete a branch git branch -d branchname git branch rm branchname # See what's been changed git status # bunch of crap got updated somehow and I know I'm up to date with master but git says otherwise git checkout -f # Color code the git UI on the linux box git config --global color.ui true

www.6tech.org/2013/01/git-cheat-sheet/

2/5

You might also like