Git is a powerful distributed version control system that enables developers to track changes in source code effectively. It supports branching and merging, allowing multiple developers to work on features simultaneously without disrupting the main codebase. This promotes collaboration and makes it easy to revert to previous versions when necessary. Overall, Git enhances productivity and helps teams coordinate their work effectively.
git init my_repo
git clone https://github.com/user/repo.git
git status
git add file.txt
git add .
git commit -m "Fix issue with user login"
git log
git checkout feature-branch
git branch
git branch new-feature
git merge feature-branch
git pull origin main
git push origin main
git remote add origin https://github.com/user/repo.git
git remote -v
git stash
git stash pop
git rebase main
git reset file.txt
git reset --hard HEAD
git cherry-pick abc1234
git tag v1.0
git fetch origin
git diff
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git rebase -i HEAD~3
git merge --no-ff feature-branch
git merge --squash feature-branch
git merge --abort
git rebase --onto newbase upstream branch
git rebase -i HEAD~4
git rebase --continue
git rebase --skip
git cherry-pick --no-commit abc1234
git reflog