I am attempting to pull my code from a remote repo. When I run 'git pull' I get the following message:
$ git pull
's password:
fatal: 'var/www/html' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.Here's my config settings:
$ git config -l
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
merge.tool=tortoisemerge
gui.recentrepo=C:/Users/Chris/Dev/Projects/html
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
remote.origin.url=:var/www/html
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
user.name=Chris Barnhill
user.email=*@gmail.com
gui.wmstate=normal
gui.geometry=887x427+26+26 171 192By the way, 'gui.recentrepo' is wrong. My local repo is located in /Users/Chris/Dev/Projects/Hyperspace/html'
2 Answers
Are you positive of the remote repo location? Should it be /var/www/html?
It appears that you're accessing the relative path.
I'm answering based on your updated question. You are trying to push to a non-bare repository, which means a repository that actually contains artifacts. A bare repository is one that "doesn't contain a working directory". In the remote repo, you are trying to push to, the master branch is checked out and so Git rejects the attempt.
To explain a bit further, imagine Alice, and Bob are working on the same project. Bob clones Alice's working repository, then they both went separate ways, but work on the same branch, say master. If Bob tries to push his changes to origin/master, which is Alice's working repository, and Git allows it, Alice would suddenly be working with a new state of the code base she isn't aware of (and might not want). This is just one sample scenario.