Master ruby with us

Git – create git branch

Posted by firstruby on November 2, 2008

Create new branch “demo” as,

1) git branch demo

This will create local branch “demo”

2) git checkout demo

This will switched to that branch

3) make some changes in that code, then,

git add <files>
git commit -m "<your message>"

4) git push origin demo

This will create new remote branch “demo” on github.

5) If you want someone to checkout the code from “demo” branch, then do following,

git clone <git-path>


git checkout --track -b demo origin/demo

Now, you are in “demo” branch.


One Response to “Git – create git branch”

  1. pixsell said


    […]Git – create git branch « firstruby[…]…

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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

%d bloggers like this: