Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No master branch in git / BitBucket

Tags:

git

bitbucket

I'm new to git. I'm using bitbucket with sourcetree client. I've cloned the repository from bitbucket in the sourcetree ,and then I wanted to create a Develop branch from Master. The thing is : there isn't any master branch. I've tried committing some text file , and then I was able to create that Develop branch , but I still don't see master branch in BitBucket ,so I can't create pull requests from the Develop branch to master...

What have I done wrong? Thanks

like image 445
BVtp Avatar asked Jun 10 '15 06:06

BVtp


3 Answers

master is just a name for the usual default branch. But it doesn’t need to be called that way. If you do git branch -r you can see what branches exist on your remote, so you know which branch you could create a pull request for.

If you really want a master branch, you could just create a new branch.

like image 50
poke Avatar answered Sep 24 '22 10:09

poke


If you will try to clone the empty repository, while cloning you should be getting the following message in command line prompt.

Cloning into 'test'...
warning: You appear to have cloned an empty repository.
Checking connectivity... done.

So, it means you are starting a project from scratch. In this case you have to follow the following steps -

mkdir /path/to/your/project
cd /path/to/your/project
git init
git remote add origin "Your Repo Url"
git add -A
git commit -m 'Your Commit Message'
git push -u origin master

Same streps are also mentioned in bitbucket home page of your repository. It will create your master branch.

like image 38
Abhishek Avatar answered Sep 23 '22 10:09

Abhishek


You have to initialize your repository with your username and name, after that your master branch will be created and you will be able to commit your code.

git config --global user.email "[email protected]"
git config --global user.name "Your Name"
like image 31
Mohit Khandelwal Avatar answered Sep 22 '22 10:09

Mohit Khandelwal