Setting aliases

From wikipost
Revision as of 01:36, 9 February 2024 by Admin (talk | contribs) (Created page with " <pre> creating an alias will probably save you a lot of time typing in long commands to create an alias either create one from the commandline or edit ~/.gitconfig on the commandline: git config --global alias.hist 'log --graph --all --oneline' NOTE: omitting '--global' will only set this alias for this repository editing the config file: --- [alias] hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --all --oneline --date=short --- or...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


creating an alias will probably save you a lot of time typing in long commands

to create an alias either create one from the commandline or edit ~/.gitconfig

on the commandline:

    git config --global alias.hist 'log --graph --all --oneline'

   NOTE: omitting '--global' will only set this alias for this repository


editing the config file:

---
[alias]
        hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --all --oneline --date=short

---


or setting it from the command line:

     git config --global alias.hist 'log --graph --all --oneline --pretty=format:"%h%x09%an%x09%ad%x09%s" --date=relative --abbrev-commit --decorate'