0

New to git. Using GitBash.

After setting up a bare local repository, and then initializing a new local git repository (added and committed files), I tried to do $ git remote add origin /Folder/BareFolder.git from the /Folder/RepositoryFolder.

This was all in my E: drive.

This appeared to work (no output, just the command line $) and I then did $ git push -u origin master. To which I received the following:

fatal: 'C:/Program Files/Git/Folder/BareFolder.git does not appear to be a git repository

fatal: Could not read from remote repository.

So it appears I messed up the syntax for the folder.

When I tried to do $ git remote add origin /E/Folder/BareFolder.git I get the following:

fatal: remote origin exists.

Doing a $ git status in the /RepositoryFolder gives me:

On branch master

nothing to commit, working directory clean

I'm not sure how to fix this and get it working correctly. I've followed some well viewed, highly upvoted answers here, and actually followed this particular one: StackOverflow Answer

Any help is much appreciated.

Community
  • 1
  • 1
REMESQ
  • 1,190
  • 2
  • 26
  • 60
  • are you want to push the code first time to git ? – balkaran singh May 11 '16 at 12:01
  • I am setting up a local central repository. From there I am going to `clone` three separate repositories and then add those to BitBucket. This is the first time I am pushing from a local repository I created and committed files to using `git init`. Prior to that I did `git init --bare` in the central repository. Both set up fine. It's the `git push` I messed up, I guess. – REMESQ May 11 '16 at 12:05

2 Answers2

2

It looks like your default path specified the C: given the error output. If the remote path you want to push to is on E:, then you had the right idea to redefine the remote origin, but you have to use the set-url command.

git remote set-url origin /E/Folder/BareFolder.git
Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167
0

Remove your .git folder from your folder

now open your terminal

step 1 git init

step 2 add.

step 3 commit -m "your msg"

step 4 remote add origin "your link" ()

step 5 git push origin master

balkaran singh
  • 2,754
  • 1
  • 17
  • 32