Day 4 - Source Code Management - Git & Github - Gitlab - Fundamentals-Part 1

Day 4 - Source Code Management - Git & Github - Gitlab - Fundamentals-Part 1

ยท

1 min read

๐Ÿ“œ 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 ๐Ÿ‘ค

๐Ÿ”™ 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! ๐ŸŒŸ

ย