Skip to content

Instantly share code, notes, and snippets.

@edusis
Created May 22, 2017 03:01
Show Gist options
  • Select an option

  • Save edusis/4bbb8e3cf186da503b56da3e65669ea7 to your computer and use it in GitHub Desktop.

Select an option

Save edusis/4bbb8e3cf186da503b56da3e65669ea7 to your computer and use it in GitHub Desktop.
//https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html
git config --global user.name "Sam Smith"
git config --global user.email sam@example.com
git init
git clone /path/to/repository
git clone username@host:/path/to/repository
git add <filename>
git add *
git commit -m "Commit message"
git commit -a
git push origin master
git status
git remote add origin <server>
git remote -v
git checkout -b <branchname>
git checkout <branchname>
git branch
git branch -d <branchname>
git push origin <branchname>
git push --all origin
git push origin :<branchname>
git pull
git merge <branchname>
git diff
git diff --base <filename>
git diff <sourcebranch> <targetbranch>
git add <filename>
git tag 1.0.0 <commitID>
git log
git push --tags origin
git checkout -- <filename>
git fetch origin
git reset --hard origin/master
git grep "foo()"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment