Advertisement
netang

git commands

Jan 23rd, 2020 (edited)
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. # Undoing the Last Commit
  2. git reset --soft HEAD~1
  3.  
  4. # rollback commit with new commit
  5. git revert %commit_hash%
  6.  
  7. # merge into master
  8. git checkout master
  9. git merge develop
  10. git pull
  11.  
  12. # merge one commit
  13. git cherry-pick <commit>
  14.  
  15. #
  16. git stash push -m  file
  17.  
  18. # stash only staged
  19. git stash -- $(git diff --staged --name-only)
  20.  
  21. # take file from another branch
  22. git checkout branch_name replay/dataframe_bucketizer.py
  23.  
  24. # get: switch branch when --skip-worktree
  25. cd client
  26. git update-index --no-skip-worktree .env.production.local
  27. git update-index --no-skip-worktree .env.development.local
  28. cd ../server
  29. git update-index --no-skip-worktree config.yaml
  30.  
  31. git stash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement