git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Carlos Martín Nieto" <cmn@elego.de>
To: ruperty <rupert@moonsit.co.uk>
Cc: git@vger.kernel.org
Subject: Re: Commit changes to remote repository
Date: Sat, 14 Jan 2012 12:31:41 +0100	[thread overview]
Message-ID: <20120114113141.GG2850@centaur.lab.cmartin.tk> (raw)
In-Reply-To: <1326486589088-7185551.post@n2.nabble.com>

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

On Fri, Jan 13, 2012 at 12:29:49PM -0800, ruperty wrote:
> Being new to git I am probably not doing things correctly so pointers in the
> right direction would be useful.
> 
> What I want to do make changes on my laptop and commit them to a remote
> repository. Here is what I have done,
> 
> 1. Created a repository on my remote linux host, in a folder of cource code,
> by,
> 
>    git init
>    git add *
>    git commit
> 
> 2. On my laptop I did a git clone pointing by ssh to the remote repo which
> downloaded all the files to my local system.
> 
> 3. I changed a file locally and did a commit.
> 
> 4. I then wanted to update the remote repo with my change, which I did with
> a git push, but that didn't work, getting this error,
> 
>     remote: error: refusing to update checked out branch:
> refs/heads/master^[[K
>     remote: error: By default, updating the current branch in a non-bare
> repository^[[K.......
> 
> 
> What am I doing wrong?

You're trying to push to a non-bare repository and change the
currently active branch, which can cause problems, so git isn't
letting you. There's an explanation of bare and non-bare at
http://bare-vs-nonbare.gitrecipes.de/ but the short and sweet is that
you should init the repo you want to use as the central point with
--bare and do modifications locally and then push there.

   cmn

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2012-01-14 11:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 20:29 Commit changes to remote repository ruperty
2012-01-14 11:31 ` Carlos Martín Nieto [this message]
2012-01-14 14:27   ` Matthieu Moy
2012-01-17  0:12     ` Junio C Hamano

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=20120114113141.GG2850@centaur.lab.cmartin.tk \
    --to=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=rupert@moonsit.co.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).