#for new (Mostly used ones)
git init # one time command to initialize git in that folder
git clone repository-url # to clone any repository.
git add -A # add all the files kinda will stage all the files and subfiles
git commit -m "message goes here" # will commit all the files that were added in above stage
git branch -M main # to rename master to main
git remote add origin "git link will go here" # get connected with cloud git
git push origin main
# Configurations
git config --global user.name "RS"
git config --global user.email rs@example.com
git config --global user.password
git checkout name-of-the-branch #to checkout/move to name-of-the-branch branch.
git checkout -b name-of-the-branch # to create new branch and then it will auto move us to that branch.
git pull origin name-of-the-branch # to pull all the code from name-of-the-branch to our ide
# Resolve conflicts in current branch
git fetch origin # it'll update all refs
git merge origin/master
# now resolve conflicts (recommended: use vscode)