Skip to content

Latest commit

 

History

History
129 lines (97 loc) · 3.6 KB

README.md

File metadata and controls

129 lines (97 loc) · 3.6 KB

README

Demonstrates some examples of using git queries and tools

Contents

TODO:

Sections

Installing a new machine

Goto chrisguest75/sysadmin_examples08_ssh/README.md to show how to generate keys.

git config --local user.email "[email protected]"
git config --local user.name "Chris Guest"

Upgrade

# see latest version of git
brew info git

# take latest version
brew upgrade git

Git Extras

Git extras are a set of helpers for git.

MacOS

# see latest version of git-extras
brew info git-extras

# macosx extras and gh cli
brew install git-extras

# github cli
brew install gh

# gitlab cli
brew install glab  

Linux
brew.sh required for gh on ubuntu/debian linuxbrew

# debian
apt install git-extras

Open repo in code

# sometimes you might be in a subdirectory in the repo
code $(git root)

Examining repos

# count number of commits
git rev-list HEAD --count

# Files changed since yesterday on current branch.
git effort -- --since='yesterday'
git effort -- --since='1 month ago'

Clean

To restore a repo to a fresh clone.

# -x Don’t use the standard ignore rules
# -d Specify -d to have it recurse into such directories
# -f Force
git clean -xfd

Resources

  • Git --fast-version-control here
  • git-extras are a really good set of useful supplementary commands.
  • github cli tool that supports creating PRs directly from the shell
  • Git Release Notes here
  • Git blog from github here
  • Git Rev News here
  • Learn Git Branching here