4

I have a Git repository at https://user_name@bitbucket.org/path/git.git. This repository has a branch called feature/myFeature, which I want to check out. I have run

git init

in the desired folder, and then, according to Bitbucket, I need to run

git fetch && git checkout feature/myFeature

However, I get the following error,

fatal: No remote repository specified. Please, specify either a URL or a remote name from which new revisions should be fetched.

I guess I need to specify the repository, but I don't know how exactly to do this, and at the same time specify the branch.

What should I do?

jub0bs
  • 54,300
  • 24
  • 162
  • 166
ChrisC
  • 868
  • 2
  • 11
  • 28

1 Answers1

8

You need to add a remote first (git init just created an empty local repo):

git remote add origin https://user_name@bitbucket.org/path/git.git

Then you can fetch and checkout the remote tracking branch

Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755