I have been given access to a git repository. I would like to create a new branch to the existing code. I am unable to find proper steps online to do this process. I believe i should first setup the master in git bash and then create a branch. If anyone can give me the sequence of steps to be followed, that would be helpful.
2 Answers
First step is, creating the clone of the remote branch
git clone <git repo> <folder_name> example:
$ git clone git://git.kernel.org/abc my2.6 change directory to the newly formed directory ie my2.6
$ cd my2.6 Creating a new branch
git branch <branch name> $ git branch my2.6.14 Go to new branch:
git checkout <branch name> example:
$ git checkout my2.6.14 Comments
The git pro book is a great source to find information and learning about git: http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging.
First make sure you have cloned the git repository using git clone command. After that you can check the current branch with this command: git branch
You can create new branch using this command: git checkout -b mybranch