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
  • 60,866
  • 25
  • 183
  • 186
ChrisC
  • 892
  • 2
  • 12
  • 33

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,262,500
  • 529
  • 4,410
  • 5,250