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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s