I've been searching around to find out how to fix this issue but I can't seem to find anything that works for me. So I thought I'd ask you.
I've recently learned how to use git for source control and decided I wanted to start using it for a website I had already built. The server I have the website on (Not my own. Buying server space from arvixe) already had git installed. I started setting up by going to my home folder (via ssh) and running
git init
I then wanted to add all the files I already had in the folder to git so I ran:
git add .
and then to commit them:
git commit .
I wanted to be able to push to the server from my laptop so I did this to get a bare repository:
git init --bare
(I did this after googling the issue and finding that it worked in other cases. Before this I tried checking out a dummy branch via ssh but when I did this nothing I pushed from my laptop to the server actually changed anything.)
After this I cloned the repository on to my laptop via ssh and sourcetree. When I make changes on my laptop and try to push them to the remote repo I get this error message:
stdin: is not a tty
/etc/bashrc: line 100: $HISTFILE: ambiguous redirect
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
remote: error: is denied, because it will make the index and work tree inconsistent[K
remote: error: with what you pushed, and will require 'git reset --hard' to match[K
remote: error: the work tree to HEAD.[K
remote: error: [K
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to[K
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into[K
remote: error: its current branch; however, this is not recommended unless you[K
remote: error: arranged to update its work tree to match what you pushed in some[K
remote: error: other way.[K
remote: error: [K
remote: error: To squelch this message and still keep the default behaviour, set[K
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.[K
To ssh://ihlenfmt@laurieihlenfield.com/home/ihlenfmt
! [remote rejected] master -> master (branch is currently checked out)
I'm very new to git so it's highly likely I've done something stupid. Anyone see where I've gone wrong?