Professional Reference Guide for Version Control and Collaboration
Git is a distributed version control system that allows you to track changes in your project history and work with different versions efficiently.
GitHub is a cloud-based platform that hosts Git repositories and facilitates collaboration, code sharing, and project management.
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/USERNAME/REPO_NAME.git
git push -u origin main
If you created a repository on GitHub with README, license, or .gitignore files, you'll need to pull those changes first before pushing your local code.
git pull origin main --allow-unrelated-histories
git remote -v
git remote remove origin
git branch
git branch -a
git checkout -b feature-branch
git switch -c branch-name
git merge feature-branch
git push -u origin branch-name
git branch -d branch-name
git branch -D branch-name
git clone https://github.com/username/repository-name.git
git status
git log