you are using a non-bare repository on the remote side. Such repositories
always have a branch checked out (read: the contents of its commits are
written to actual files on the disk). On the other side, bare repositories
are just that: bare. This means that they store all commits, but not in
actual files, but in git objects.
When you push your changes to a remote bare repository, your commits are
simply copied over to the other machine (OK, there are several other things
happening, but let’s see only the basic picture now).
When the remote is not bare with the branch master checked out, and you
push your branch ben, the story is just the same as with bare repositories.
However, if you are pushing ben while that branch is checked out (read: its
contents exist as actual files), those files would be overwritten, which is
not recommended (thus, refused by git).
If you don’t need the files on the remote site, just want to store your
commits at another place, you should remove your remote directory (after
saving your work to your local copy, if any!), and recreate it with git
init --bare. If, however, you do need those files, you should either use an
intermediate bare repository, where you can push from your local, and pull
from there on your current remote), or have a somewhat complicated workflow
involving branch-creation/deletion before every push.
Also, if you are really new to git, you should read some getting started
docs, like .
PS: Using Linux as root is a bad idea ;)
On 4 May 2014 22:51, Benjamin Fontaine <bmx...@gmail.com> wrote:
> Hello and thanks for this group
> I'm new to Git ( I was asked to learn it in my last job interviews, and
> I've configured it this far .. )
> Master on my webserver, did a clone, put both to branch "ben", did
> commit, and then the push fails
> Any ideas ?
> Thank in advance for further comments
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.