The most useful GIT codes

Finally I decided to write all codes of GIT that I need and I should search for them every time.

Here you are, some of most important and useful codes you need to know for daily works.
information of active branch and changed files

git status

create a new branch and switch to it

git checkout -b [branch_name]

get the list of branches

git branch

delete an existing local branch

git branch -d [branch_name]

update master branch

git checkout master
git pull

update a branch with master

git checkout [branch_name]
git merge master

add files to stage

git add [file_name]
OR git add . // all files

commit staged files

git commit -m "[message for commit]"

 

Leave a Reply

Your email address will not be published.