Demonstrates some examples of using git
queries and tools
TODO:
- Deleting branches
- git filter-repo - https://github.com/newren/git-filter-repo
- git reset --hard origin/feature reset against a new pushed version of a branch.
- .gitattributes https://git-scm.com/docs/gitattributes
- git update-index --assume-unchanged sites/default/settings.php
- git check-ignore vscode/list_extensions.sh
- git bisect example
- https://git-scm.com/docs/git-notes
- Do some tests on HEAD. git log HEAD -n 1, git log origin/HEAD -n 1. Fixing
git log origin/HEAD..HEAD -n 1
missinggit remote set-head origin -a
https://learnku.com/articles/71493
- FAQS - FAQS.md
- Rebasing fun - REBASING_FUN.md
- Squashing Walkthrough - SQUASHING_WALKTHROUGH.md
- Reverting and Rollback Walkthrough - ROLLBACK_WALKTHROUGH.md
- Creating new repos - NEW_REPOS.md
- Patching - PATCHING.md
- Hooks - HOOKS.md
- Worktrees - WORKTREES.md
- Stashing - STASH.md
- Searching - SEARCHING.md
- Git Crypt - GIT_CRYPT.md
- Helper Scripts - HELPER_SCRIPTS.md
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"
# see latest version of git
brew info git
# take latest version
brew upgrade git
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
# sometimes you might be in a subdirectory in the repo
code $(git root)
# 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'
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
- 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