Lore

If it's worth remembering, it's worth writing down, if I find the time, and remember...

User Tools

Site Tools


git

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
git [2018/05/11 00:02] thekojukinatorgit [2019/05/08 16:08] (current) – [PowerShell Visual Studio Code Template] thekojukinator
Line 35: Line 35:
 </code> </code>
  
 +A complementary setting in //Visual Studio Code// when developing on Windows is to enforce CRLF.
 +
 +<code css settings.json>
 +{
 +    // this assumes Windows dev environment with Git config option "core.autocrlf=true"
 +    "files.eol": "\r\n"
 +}
 +</code>
 ==== Pretty Log Alias ==== ==== Pretty Log Alias ====
  
Line 43: Line 51:
 <code bash> <code bash>
 git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
 +# or without pagination
 +git --no-pager log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
 </code> </code>
  
Line 49: Line 59:
 <code bash> <code bash>
 git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short" git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
 +# unfortunately these won't work...
 +git config --global alias.hist "--no-pager log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
 +git config --global alias.hist "!git --no-pager log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
 +# but, this will disable pagination for all calls to 'log'
 +git config --global pager.log false
 +
 +# I've recently discovered some prettier log outputs, so my .gitconfig aliases are like so...
 +hist = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
 +hist1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
 +hist2 = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
 +# first two are courtesy of https://stackoverflow.com/a/9074343
 </code> </code>
  
Line 537: Line 558:
 !*/ !*/
  
-# allow .gitignore at top level +# allow .git* at top level 
-!.gitignore+!.git*
  
-whitelist these file types everywhere +allow .md at top level 
-!**/*.ps1 +!*.md 
-!**/*.psm1 + 
-!**/*.psd1 +# whitelist VSCode settings at the top level 
-!**/*.xml+!/.vscode/settings.json 
 + 
 +# whitelist contents of these folders at the top level 
 +!/ProjectFolderContainingAllTheGoodies/** 
 + 
 +# regardless of above, ignore these folders and files everywhere 
 +**/_logs
 +**/_testing*
  
-# regardless of above, ignore '.vscode' folder everywhere 
-**\.vscode/ 
 </code> </code>
  
git.1526011356.txt.gz · Last modified: 2018/05/11 00:02 by thekojukinator