configuration - git pull returns "not a git repository" error
2013-08
I am attempting to pull my code from a remote repo. When I run 'git pull' I get the following message:
$ git pull
[email protected]'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=[email protected]: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 192
BTW, 'gui.recentrepo' is wrong. My local repo is located in '/Users/Chris/Dev/Projects/Hyperspace/html'
I don't know how to edit my original message, so I'm replying to northben here:
I successfully cloned my repo to a new directory.
Then I edited a file in working copy, committed it, and tried to push it to the remote repo. Here's the error I got:
$ git push origin master
[email protected]'s password:
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 456 bytes | 0 bytes/s, done.
Total 5 (delta 4), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsist
ent
remote: error: with what you pushed, and will require 'git reset --hard' to matc
h
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To [email protected]:/var/www/html
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '[email protected]:/var/www/html'
Do you have any ideas on how I can resolve this? Thanks.
I really don't like the git staging area, it just makes my life unnecessarily confusing.
Is it possible to disable it so that all edited and new files are in a single context? So that git diff shows the diff between the repository and my working directory (and I don't have to also type git diff --cached) and so that git ci checks in my whole working copy (not just the part that's staged).
If not, alternatives (like setting up cofigurations) so that it appears that I don't have a staging are would be great too.
Thanks, -Shawn
The staging area is a core concept of Git. I also thought it unnecessary at first, but it can be really useful when you must commit only some changes.
So my suggestion is either to
- get used to it,
- or switch to another SCM that doesn't use a staging area.
git config alias.ci "commit -a"
You can (almost) forget about it if you always do "git commit -a ..." (i.e., commit all changes to files git has under version control). But now and then you'll need the staging area: Say you have changes to a bunch of files, and only want to checkin some of them. It is handy to be able to go "hack, hack, hack, git add file1, hack hack hack, git add file2, hack hack, git commit -m change1, hack more, git add file1 file2 file3, git commit -m change2"