Day 4 - Source Code Management - Git & Github - Gitlab - Fundamentals-Part 1
๐ Version Control and Git Basics ๐
Discover the world of version control and Git, a powerful collaboration tool! ๐
๐ค Git Basics ๐ค
Initialize Git:
git init
๐ฆ Staging Files ๐ฆ
Track changes:
git add test.txt
Commit changes:
git commit -m "adding files"
๐ Viewing Changes ๐
View logs:
git log
Compact logs:
git log --oneline
๐ค Author Info ๐ค
Set author:
git config --global
user.name
"emx.xubi"
Set email:
git config --global
user.email
"
emx.xubi@gmail.com
"
๐ Undo & Status ๐
Restore changes:
git restore
Check status:
git status
๐ฟ Branching ๐ฟ
List branches:
git branch
Create branch:
git checkout -b dev
Switch branch:
git checkout dev
๐ Remotes & Collaboration ๐
View remotes:
git remote -v
Pull changes:
git pull origin main
Push changes:
git push origin main
๐ Authentication ๐
Set up token: [GitHub Developer Settings]
Update remote URL:
git remote set-url origin
๐ Clone vs Fork ๐
Clone: Copy entire repo to local
Fork: Duplicate repo under your account
Dive into Git's fascinating universe, boost your productivity, and ace collaboration with ease! ๐