Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
1,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. # List all the changes
  2. git status
  3.  
  4. # Add new changes
  5. git add <file_name>
  6.  
  7. # Or add all the changes
  8. git add .
  9.  
  10. # commit new changes
  11. git commit -m "commit description"
  12.  
  13. # To discard changes
  14. git checkout --<file>
  15.  
  16. # Undo last commit
  17. git reset HEAD~
  18.  
  19. # Add new remote
  20. git remote add origin <repo_URL>
  21.  
  22. # See the current remote
  23. git remote -v
  24.  
  25. # Remove origin from git repo
  26. git remote remove origin
  27.  
  28. # Push the new commits
  29. git push origin <branch_name>
  30.  
  31. # Pull from a branch
  32. git pull origin <branch_name>
  33.  
  34. # List all branches
  35. git branch
  36.  
  37. # Create new branch
  38. git branch <branch_name>
  39.  
  40. # Remove a branch
  41. git branch -D <branch_name>
  42.  
  43. # Change to another branch
  44. git checkout <branch_name>
  45.  
  46. # Discard changes (save for later)
  47. git stash
  48.  
  49. # Apply discarded changes again
  50. git stash pop
  51.  
  52. # Remove file from git repo
  53. git rm <file_name>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement