1

I have been struggling with this for a while now and was wondering how to add a branch with new files.

It seems simple and it is not an ssh key problem as I can add and edit other branches without problem and am an owner on the repo.

Although I get:

fatal: 'XXXXX' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Florian Neumann
  • 5,587
  • 1
  • 39
  • 48
  • What do you mean by 'add a branch'? Do you mean create the branch or push the branch? That error is saying that you didn't connect to a remote repository, nothing about a branch. What command did you run? – Leigh May 12 '14 at 02:06

1 Answers1

0

Reminder: creating a new folder (like 'XXXXX') isn't the same as creating a new branch.

If you want a new branch with new files, ie a completely new content, you can:

  • remain in your git repo (where there are files already)
  • create an orphan branch (a branch with no commit parent, so its content will be empty)

    git checkout --orphan newBranch
    

(See more at "In git, is there a simple way of introducing an unrelated branch to a repository?")

  • add your files there (you will see that the working tree is empty in that new orphan branch)
  • commit and push

    git push -u origin newBranch
    
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250