Skip to main content

Posts

Recent posts
Useful 10 git commands 1.git checkout -b <branchname> :  create a branch from the parent branch and checkout the branch. 2.git checkout – : switch between 2 branches. (between last branch and the current branch) 3.git diff <filename> : dump the changes of the file in the console by comparing it with the       unmodifed file. 4.git add . && git commit -m “commit message” : add all the changes and commit with a message. Here basically we are executing 2 commands with ‘&&’. 5.git log –oneline : get all the commit messages in the current branch and display in one line with the hashcode. git branch -a : view  all local and remote branches in the repositories. 6.git branch -D <branchname> : delete a local (un-merged) branch. Note you cannot delete a branch when it is your current branch. 7.git push origin :<branchname> : delete a remote branch. git fetch origin <branchname> : fetch a specific remote branch ...