An Interest In:
Web News this Week
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
April 9, 2022 07:27 pm GMT
Original Link: https://dev.to/sujithvsuresh/important-git-commands-4n38
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:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To