git init
git config --global user.name "Ajay Kumar Reddy"
git config --global user.email "[email protected]"
git status
git add filename (or) git add .
git rm --cached filename
git reset HEAD filename
git reset HEAD .
git commit->then press i for Insert Mode,type your message,press Esc to exit insert mode,press :wq and Enter
git commit -m "commit message comes here"
git reset --hard HEAD~1 (Note: All the changes of last commit gets removed.)
git branch (or) git branch -a (or) git branch -r
git branch branchname
git checkout branchname
git merge branchname(branch to be merged)
git remote
git remote add origin https://github.com/ajaykumareddy/projects.git
git branch --set-upstream-to origin/ (or) git branch --set-upstream-to master origin/master
git push -u origin master (or) git push --set-upstream origin master
git pull
git branch -d master -> delete branch locally
git push origin --delete master -> delete branch remote
git clone clone/to/path foldername(if particular folder required)
touch .gitignore -> creates a .gitignore file and add *.extension