Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 9, 2022 07:27 pm GMT

Important Git Commands

git status = will show us status.git log = it shows all commit.git add . = to add file to the git repository.git commit -m "commit message"git branch = to know corresponding branchgit init = it create git file in folders.(initialize)git checkout -b #branch name# = it creates new branch (-b) and bring us to that branch.git checkout #branchname# = to switch branchgit checkout filename = it will discard the changes made to the file.(works before add .)git diff = it shows the changes made to the file.(it works only before add)git add -u = to add the already added modified file.git reset #filename# = it removes the added files.(it works only before commit and after add.)git merge #branch_name# = to move changes made in one branch to another.git clone #https repo link# = it will take that repo to our local machine folderfork = to add others githb repo to our githb repogit push origin master = for pushing to repogit config user.name "name"git config user.email "email"

Original Link: https://dev.to/sujithvsuresh/important-git-commands-4n38

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To