1

I must admit that I'm totally confused about initialising Git - though it's not for the first time really.

I first downloaded original Git bash and made a repository something at C:\xampp\htdocs\something. At the same time, I created something repository under my profile. I thought they might link together then (after I log in) - such naivity was soon punished.

Then I realised that this Git bash really doesn't like me, so I downloaded standard "Git for windows". I deleted .git in C:\xampp\htdocs\something, and I deleted the online version of the repository. I also looked at Documents\GitHub\ for something folder, but it's not there.

But well, sounds like I didn't delete it enough - have a look: repository already exists
So where else does Git store data about existing repos? Will I have to pick different name just because of this? Can I list the repositories to see why it happens?

Initialising repo through console (success)

Possible workaround is using the Git shell console:

cd C:\xampp\htdocs\something
git init
Initialized empty Git repository in C:/xampp/htdocs/rimedit/.git/

Pushing with GUI application (failed)

But using console is a workaround, not an answer. Also I still can't push because of this: Failed to push

Pushing with console (failed too)

To piss me of as much as possible, this is what console throws upon pushing:

remote: Repository not found.
fatal: repository 'https://github.com/Darker/rimedit.git/' not found

Note that the error is the exact opposite to the one I get with the GUI application.

Deleting cache

Git stores some cached data and account information at %APPDATA%\GitHub\ (thanks Chris). Deleting the cache did not solve the problem - it appears that it might be server-sided.

Finally a solution (not an answer)

The Repository not found. in the console was simply fixed by creating the repository on the server once again. After this, I'd get this for push:

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Darker/rimedit.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

So I wanted to pull, but again an error:

 * [new branch]      master     -> git/master
You asked to pull from the remote 'git', but did not specify
a branch. Because this is not the default configured remote

So, after all, I have found this post. I edited my config to look like this:

[remote "git"]
  url = https://github.com/<account name>/<repo name>.git
  fetch = +refs/heads/*:refs/remotes/git/*

[branch "master"]
  remote = git
  merge = refs/heads/master

After this, all I needed was to pull the readme.md and then push all my data.

Community
  • 1
  • 1
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • I also suspect that there is a problem on the server. At this point you may want to [contact GitHub support](https://github.com/contact). – ChrisGPT was on strike Jan 13 '14 at 20:05
  • I did contact them. I'm waiting for reply already. I was in touch with them for a while - but they don't know anything for sure, so this might be a bug. The `git init` solution came from github support. – Tomáš Zato Jan 13 '14 at 20:17

3 Answers3

0

.git is the only directory with git metadata. So if specific directory is the child directory of some directory that have .git directory, it is some kind of inside a git repository.

Maybe there is some "Git for Windows" metadata that made it possible to recognize previously existing repository. Or you still have .git directory with git metadata files.

  • No `.git` folders exist in any searchable folder in whole `C:` (I searched carefully). I have strong suspition that git GUI application has it cached somewhere. – Tomáš Zato Jan 13 '14 at 18:32
0

Look in your Documents\GitHub\ for a directory called something. Delete that and you should be on your way.

GitHub for Windows also saves information in %APPDATA%\GitHub\, but this does not appear to be relevant to your problem.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
0

git push /f will overide the repositary

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32326883) – Simas Joneliunas Jul 28 '22 at 03:29