Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Basic Git commands.
- git clone <url> - get the repository
- git commit -a -m "Commit message here." - Commit all changes to current branch
- git checkout <existing_branch_name> - switch to branch
- git checkout -b <new_branch_name> - create a new branch and switch to it
- git reset --hard - destroy ALL local changes made to current branch
- git cherry-pick <commitid> - patch in JUST the changes made in the commitid provided
- git fetch <url> - download repository from online, but keep it in a cache (useful for cherry-picking commits in forks you don't have)
- Git Push / Pull.
- git push - push all changes to the current remote+branch
- git push -u origin master - push all changes to remote "origin" branch "master" and set push to push there by default
- git pull - pull all changes from the current remote+branch and merge them with the current local branch
- Git creation.
- git init - create a git repository in the current directory
- git remote add origin <url> - set the remote "origin" to the url. This is usually provided by Github or similar.
Advertisement
Add Comment
Please, Sign In to add comment