User Tools

Site Tools


tutorials:git_quick_reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:git_quick_reference [2019/04/18 14:19]
marcus.williams [Add, commit & push]
tutorials:git_quick_reference [2020/01/03 18:29] (current)
marcus.williams [Stash]
Line 37: Line 37:
 <​code>​ <​code>​
 git push --force origin master git push --force origin master
 +</​code>​
 +
 +Pull with forced overwrite [[https://​stackoverflow.com/​questions/​1125968/​how-do-i-force-git-pull-to-overwrite-local-files|link]]:​
 +<​code>​
 +git fetch --all
 +git reset --hard origin/​master
 +</​code>​
 +
 +===== Stash =====
 +<​code>​
 +git stash
 +</​code>​
 +Records the current state of the working directory. This command saves your local modifications away and reverts the working directory to match the HEAD commit.
 +
 +[[https://​stackoverflow.com/​questions/​1260748/​how-do-i-remove-a-submodule|How to remove a submodule]]
 +
 +===== Checkout =====
 +
 +Reset file foo to HEAD. Stackoverflow [[https://​stackoverflow.com/​questions/​215718/​how-can-i-reset-or-revert-a-file-to-a-specific-revision|link1]]
 +<​code>​
 +git checkout -- foo
 </​code>​ </​code>​
  
tutorials/git_quick_reference.1555597144.txt.gz ยท Last modified: 2019/04/18 14:19 by marcus.williams