git commands

Some important git commands.

git  init
git  add name-of-file
git add -a

Git commit stores the changes made to the file in the local repository

git commit -m “message”

git status 

git config --global user.name "Arunlal”
git config --global user.email emailaddress@gmail.com

git branch

git branch newbranch
git checkout -b newbranch

git checkout newbranch (branch switching)

Switch to master

git master newbranch

git branch -d newbranch (using capital D possible, but delete all , -d will shows warnings)

git clone git@github.com:arunlal7701/newclone

git pull orgin master

git revert id ( from logs)


git rebase master (stores outside the repository)

Alice and bob updating same file

git pull -rebase 

git mergetools

git rebase --continue

Post navigation

Leave a Reply