Skip to content

Git🔗

Back | Detailed Guide

Installation🔗

Install Git:

apt-get install git

Configuration🔗

Edit: ~/.gitconfig

[user]  
    name = smk  
    email = [email protected]  
[alias]  
    st = status -sb  
    lg = log --graph --abbrev-commit --decorate  
[core]  
    editor = vim  

Common Workflows🔗

Clone a repository

git clone https://github.com/user/repo.git

Create and push branch

git checkout -b feature  
git add .  
git commit -m "Add feature"  
git push -u origin feature  

Pro Tips🔗

  1. Rebase: Squash commits with git rebase -i HEAD~3.
  2. Stash: Temporarily save changes with git stash.
  3. Reflog: Recover lost commits via git reflog.

See Also🔗