(01)Install Git
Linux
1# Ubuntu / Debian2sudo apt-get update && sudo apt-get install -y git3 4# RHEL / Fedora5sudo dnf install -y gitWhat is this?
Git tracks every change to your code so you can undo mistakes and collaborate with others.
Where to create or edit the main configuration — paths below match the setup steps.
~/.gitconfigLocation: User home
Global user.name, user.email, aliases
.git/configLocation: Inside each repository
Repo remotes and branch settings
Step 01
1# Ubuntu / Debian2sudo apt-get update && sudo apt-get install -y git3 4# RHEL / Fedora5sudo dnf install -y git1git config --global user.name "Your Name"2git config --global user.email "you@example.com"3git config --global init.defaultBranch main4git config --global --listStep 02
1git --versionStep 03
1git init2git clone https://github.com/user/repo.git3git status4git add .5git commit -m "Initial commit"6git push origin main1git branch2git checkout -b feature/new-feature3git merge feature/new-feature4git branch -d feature/new-feature5git push origin --delete feature/new-feature1git remote -v2git fetch origin3git pull origin main4git push origin main5git log --oneline -10Step 04
1# Use SSH instead of HTTPS, or set credential helper2git remote -v3git remote set-url origin git@github.com:user/repo.git4ssh -T git@github.com