the single path

git-help

Get Git Help
git help
In video
  • git help - help summary
  • git help -a — available subcommands
  • git help -g — concept guides
  • git help git - overview (full manual)
  • git help <command> - subcommand documentation

git-init

Create and new git repository
git init my-git-notes
In video
  • cd my-git-notes
  • ls
  • ls --all
  • ls .git
  • git help init

git-status

Get the status of a git repository
git status
In video
  • git status
  • rm -vfr .git
  • git status
  • git init

git-add

Add to git index
git add .
git add some-file.txt
git add path/to/file.txt
git add '*.txt'
git add -p
In video
  • git add help

git-reset

Reset git index
git reset .
git reset some-file.txt
git reset path/to/file.txt
git reset '*.txt'
git reset -p
In video
  • git reset help

git-commit

Commit index to the git repository
git commit -m "add git notes files"
git commit # defaults to VISUAL or EDITOR (likely Vim)
GIT_EDITOR="code --wait" git commit
In video
  • git commit
  • brings up editor

https://stackoverflow.com/a/36644561

  • core.editor = nvim

git-log

Terminal window
git log
git log --pretty=oneline
git log --pretty=oneline --abbrev-commit
git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative

git-diff

Add a change to one of the files.

echo "git add help" > git-add.txt

"
git diff
git diff --staged
git diff head
git diff head~

https://www.golinuxcloud.com/git-head-caret-vs-tilde-at-sign-examples/

  • add more to git to stage

git-remote

git-push

git-pull

git-fetch

git-clone

on configuring git

Let’s add got config for all of our options