Git tip: Create new branch in remote repository

1. Change directory to the desired folder in the local macine.

2. Create repo (if needed)

git init
git remote add origin <remote-git-repo-url>

3. Create new branch

git checkout -b <new-branch-name>

(This will create the branch in local git repo.)

3. Add and commit files

git add .

git status
git commit -m "pushing to create new branch <new-branch-name>"

4. Push to create branch in remote repo

git push -u origin <new-branch-name>

Advertisements

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 )

Google+ photo

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

Connecting to %s