重要なgitコマンド

1072 ワード

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 branch
git 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 branch

git 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 folder
fork = to add others githb repo to our githb repo
git push origin master = for pushing to repo

git config user.name "name"
git config user.email "email"