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
Last revision Both sides next revision
tutorials:git_quick_reference [2019/02/28 03:21]
marcus.williams [Add variations]
tutorials:git_quick_reference [2019/09/19 19:59]
deryn.crockett
Line 9: Line 9:
 <​code>​ <​code>​
 git status git status
-git add --all+git add -A
 git commit -m "JD - commit server work" git commit -m "JD - commit server work"
 git pull origin master git pull origin master
Line 17: Line 17:
 To provide a detailed message and description from the command line: ''​git commit''​. To provide a detailed message and description from the command line: ''​git commit''​.
  
-Then ''​Insert''​ key. Commented ''#''​ lines are ignored. First list is the summary; subsequent lines are the detailed description.+Then ''​Insert''​ key. Commented ''#''​ lines are ignored. First line is the summary; subsequent lines are the detailed description.
  
 Then ''​ESC''​ key. Close the editor with '':​wq''​ (w - write, q - quit) and ''​Enter''​ key. Then ''​ESC''​ key. Close the editor with '':​wq''​ (w - write, q - quit) and ''​Enter''​ key.
Line 24: Line 24:
  
 ===== Variations ===== ===== Variations =====
-Recursively add files in folder and subfolders.+See modifications within the current directory.
 <​code>​ <​code>​
-git add *+git status .
 </​code>​ </​code>​
  
 +Recursively add files in working directory and subdirectories (new, modified, deleted).
 +<​code>​
 +git add -A .
 +</​code>​
 +
 +Push with force. Use with caution.
 +<​code>​
 +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]]
  
tutorials/git_quick_reference.txt ยท Last modified: 2020/01/03 18:29 by marcus.williams