问题
I'm brand new to git and have no experience with any version control system. I develop locally and am looking for a simpler way (than FTP) to deploy files to the (LAMP) web server. I am having a hard time configuring Git (version 2.5 for Windows) to automatically update its current working directory when I push changes. Here is what I've done, after creating a local repo, doing the first commit, and adding the remote location under alias origin:
- [remote]
ssh user@domain - [remote]
cd testgit - [remote]
git init - [remote]
git config receive.denyCurrentBranch updateInstead - [remote]
git status: nothing to commit - [remote]
exit - [local >> master]
git status: nothing added but untracked files present - [local >> master]
git push origin master
Step 8 generates one notice and two errors:
stdin: is not a ttyfatal: bad config value for 'receive.denycurrentbranch' in configfatal: Could not read from remote repository
I've been looking around but I'm stuck. What am I doing wrong?
回答1:
First, you would need to add and commit before pushing: if you have untracked files, then won't be pushed until you do add and commit.
Second, "receive.denyCurrentBranch updateInstead" is only for git 2.3+ (February 2015): make sure you have the right version of git n the server side.
Should git be installed separately on the server? I have git 2.5 on my Windows machine. I did not install anything specifically on the server
Yes you need to have git on the server as well.
来源:https://stackoverflow.com/questions/32643065/git-receive-denycurrentbranch-updateinstead-fails