Skip to content

Instantly share code, notes, and snippets.

@mertsimsek
Forked from burakaydn/Git_CheatSheet.md
Last active December 18, 2015 09:59
Show Gist options
  • Save mertsimsek/5765685 to your computer and use it in GitHub Desktop.
Save mertsimsek/5765685 to your computer and use it in GitHub Desktop.
  • Create new repository

git init

  • Configure git settings

git config –global user.name “GDG Ankara”

  • Add changes to Index

git add .

  • Commit changes

git commit -m "Why?"

  • Remove file from Index

git rm File.java

  • Repository status

git status

  • Clone repository

git clone repository_path

  • List branches

git branch

  • Switch between branches

git checkout branch_name

  • Merge branches

git merge otherbranch

  • Reset to previous commit

git reset

  • Update local repository from remote

git pull

  • Push changes to remote repository

git push remote_repo local_branch

  • Add remote repository

git remote add remote_repo_name remote_repo_path

  • Remove untracked files

git clean -f

  • Remove ignored files

git clean -f -X

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