All of lore.kernel.org
 help / color / mirror / Atom feed
From: asymptosis <asymptosis@posteo.net>
To: Rich Davis <crashvb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Unable to push to local bare repository
Date: Thu, 21 Jan 2021 10:59:52 +1100	[thread overview]
Message-ID: <YAjD+Gtm1QwdwXCq@sleipnir.acausal.realm> (raw)
In-Reply-To: <8f1df022-0e0e-2451-b32d-2d9918604ea1@gmail.com>

Hi Rich,

>$ git init barerepo
>Initialized empty Git repository in /tmp/am_i_crazy/barerepo/.git/

This looks like your problem: without passing the --bare flag, it's not a bare repo. It even says it's initialized under barerepo/.git instead of barerepo.

Compare with the result of passing --bare:

```
testuser /tmp $ git init --bare barerepo
Initialized empty Git repository in /tmp/barerepo/

testuser /tmp $ git clone --dissociate --no-hardlinks --no-local barerepo clonerepo
Cloning into 'clonerepo'...
warning: You appear to have cloned an empty repository.

testuser /tmp $ cd clonerepo/

testuser /tmp/clonerepo $ printf "This is a test file created on %s\n" "$(date +%Y-%m-%dT%H:%M:%S)" | tee test.txt
This is a test file created on 2021-01-21T10:55:35

testuser /tmp/clonerepo $ git add test.txt

testuser /tmp/clonerepo $ git commit -m "Initial commit"
[master (root-commit) b71804b] Initial commit
  1 file changed, 1 insertion(+)
  create mode 100644 test.txt

testuser /tmp/clonerepo $ git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 253 bytes | 253.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To /tmp/barerepo
  * [new branch]      master -> master
```

Hope this helps.

      reply	other threads:[~2021-01-21  0:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 21:58 Unable to push to local bare repository Rich Davis
2021-01-20 23:59 ` asymptosis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YAjD+Gtm1QwdwXCq@sleipnir.acausal.realm \
    --to=asymptosis@posteo.net \
    --cc=crashvb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.