π₯οΈ Git is a command line program. All other git interfaces are wrappers of git.
πͺ Learning CLI gives you complete control and understanding of Git operations.
π The CLI is extensive and heavy. TUIs/GUIs can make using git much easier.
Docs at https://git-scm.com/docs/user-manual .
πΊ Essential CLI Commands
git init # Initialize new repository
git clone < url> # Copy a repository
git remote add origin < url> # Define a remote called "origin"
git help < command> # Display help for a command
git status # Show working directory status
git add < file> # Stage files for commit
git add . # Stage all changes
git commit -m " message" # Create commit with message
π lazygit is a terminal-based Git interface that combines CLI power with visual convenience.
β¨οΈ Provides an intuitive, keyboard-driven interface with vim-like navigation.
π¨ Clear visual representation of repository state and history.
Source at https://github.com/jesseduffield/lazygit .
Video guide at https://youtu.be/VDXvbHZYeKY .
π lazygit Interface Layout
ββStatusββββββββββββββββββββββUnstaged changesββββββββββββββββββββββββββββββββββ
β β’ On branch main ββdiff --git i/src/kiwi.py w/src/kiwi.py β
β β’ Your branch is up to ββindex 624c7b0..cca0eea 100644 β
β date with origin/main ββ--- i/src/kiwi.py β
β β’ Changes to be commit.. ββ+++ w/src/kiwi.py β
βββββββββββββββββββββββββββββ @@ -20,4 +22,4 @@ β
ββFilesββββββββββββββββββββββ for kiwi in kiwis: β
β MM src/kiwi.py ββ - total += kiwi["price"] β
β A tests/test_new.py ββ + total += kiwi.price β
β D old_file.txt ββ return total β
β ?? untracked.log βββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββStaged changesββββββββββββββββββββββββββββββββββββ
ββBranchesβββββββββββββββββββdiff --git c/src/kiwi.py i/src/kiwi.py β
β * main ββindex fa576fb..624c7b0 100644 β
β feature/mango ββ--- c/src/kiwi.py β
β hotfix/kiwi_counting ββ+++ i/src/kiwi.py β
βββββββββββββββββββββββββββββ@@ -43,1 +44,4 @@ β
ββCommitsββββββββββββββββββββ β
β a1b2c3d Fix bug in id ββ+# Todo list: β
β e4f5g6h Add kiwi counter ββ+# - Retrieve prices/discounts from supermarkets. β
β i7j8k9l Update docs ββ+# - Setup alerts for big kiwi discounts. β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π±οΈ SourceTree is a free, full-featured Git GUI, with classical point-and-click interface.
π¨ Full graphical representation of repository history and branches.
See more at https://www.sourcetreeapp.com/ .
π² SourceTree Interface
ββ Toolbar βββββββββββββββββββββββββββββββββββββββββββββββββ
β [Commit] [Pull] [Push] [Fetch] [Branch] [Merge] [Stash] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ββ Sidebar βββ ββ File Status ββββββββββββββββββββββββββ β
β β WORKSPACE β β Unstaged files: β β
β β β’ File St..β β β src/main.py β β
β β β’ History β β β README.md β β
β β β β β β
β β BRANCHES β β Staged files: β β
β β β’ main β β β tests/test_new.py β β
β β β’ feature β β β β
β β β β β β
β β REMOTES β β [Stage All] [Unstage All] [Commit] β β
β β β’ origin β β β β
β ββββββββββββββ βββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ββ Commit Graph βββββββββββββββββββββββββββββββββββββββ β
β β β a1b2c3d Fix authentication bug (main) β β
β β β β β
β β β e4f5g6h Add user registration feature β β
β β βββ i7j8k9l Update documentation (feature) β β
β β β β β
β β β m9n0p1q Initial commit β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ