User Tools

Site Tools


docs:tips_n_tricks:git:index.html

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
docs:tips_n_tricks:git:index.html [12.05.2023 11:35 CEST] peterdocs:tips_n_tricks:git:index.html [24.03.2024 01:30 CET] (current) peter
Line 14: Line 14:
 ---- ----
  
-Preview((provided your working tree is clean)) ''git pull'':+Preview((provided your working tree is clean)) ''git pull origin master''((same as ''git pull'' in most cases)): 
   git fetch origin master ; git diff -R --stat origin/master   git fetch origin master ; git diff -R --stat origin/master
 +
 +----
 +
 +Preview((provided your working tree is clean)) ''git pull origin master''((same as ''git pull'' in most cases)), provide full patch forced agains current state in worktree:
 +
 +  git fetch origin master ; git diff -R --diff origin/master -- .
  
 ---- ----
Line 63: Line 70:
   git push [--dry-run] <remote> --delete <old branch>   git push [--dry-run] <remote> --delete <old branch>
  
 +----
 +Reset file to any version from <commitish>:
 +
 +  git checkout <commitish> -- <file>
 +
 +----
 +Show full contents of file <file> from commit, branch or tag <commitish>:
 +
 +  git show <commitish>:<file>
 +
 +__Credits__: [[https://www.serverlab.ca/scripting-programming/using-git-show-to-view-contents-of-files/|Using Git Show to View Contents of Files]]
 ---- ----
  
 {{entry>git}}{{tag>git}} {{entry>git}}{{tag>git}}
docs/tips_n_tricks/git/index.html.txt · Last modified: 24.03.2024 01:30 CET by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki