Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # List all the changes
- git status
- # Add new changes
- git add <file_name>
- # Or add all the changes
- git add .
- # commit new changes
- git commit -m "commit description"
- # To discard changes
- git checkout --<file>
- # Undo last commit
- git reset HEAD~
- # Add new remote
- git remote add origin <repo_URL>
- # See the current remote
- git remote -v
- # Remove origin from git repo
- git remote remove origin
- # Push the new commits
- git push origin <branch_name>
- # Pull from a branch
- git pull origin <branch_name>
- # List all branches
- git branch
- # Create new branch
- git branch <branch_name>
- # Remove a branch
- git branch -D <branch_name>
- # Change to another branch
- git checkout <branch_name>
- # Discard changes (save for later)
- git stash
- # Apply discarded changes again
- git stash pop
- # Remove file from git repo
- git rm <file_name>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement