Git for windows: fatal: early EOF - windows

Yesterday I installed a new Git windows server 2.6.4 that was working fine with a Mac git client (git protocol)
Today I am struggling to get a 2nd client (Windows 7) to work. In the process of trying to make it work I have upgraded both the Windows server and client to the recently released git 2.7.0
I have tried disabling compression...I have tried both wireless and wired networks (the Windows client and server are sitting on the same desk). I have disabled AV on the client. I have tried tweaking the memory settings as suggested here
Here is the client output:
bash> git clone git://server.fqdn/repo.git
Cloning into 'repo'...
remote: 08:56:10.972997 git.c:348 trace: built-in: git 'pack-objects' '--revs' '--thin' '--stdout' '--progress' '--delta-base-offset'
remote: Counting objects: 76, done.
remote: Compressing objects: 100% (38/38), done.
Receiving objects: 100% (76/76), 8.31 KiB | 0 bytes/s, done.
fatal: read error: Invalid argument
fatal: early EOF
fatal: index-pack failed
bash>
Here is the server output:
bash> ./gitd.bat
D:\tools\gitd>set GIT_TRACE=1
D:\tools\gitd>D:\tools\Git\bin\git.exe daemon --reuseaddr --verbose --base-path=D:\git --export-all --enable=receive-pack
08:59:49.023778 git.c:561 trace: exec: 'git-daemon' '--reuseaddr' '--verbose' '--base-path=D:\git' '--export-all' '--enable=receive-pack'
08:59:49.023778 run-command.c:343 trace: run_command: 'git-daemon' '--reuseaddr' '--verbose' '--base-path=D:\git' '--export-all' '--enable=receive-pack'
[7376] Ready to rumble
09:00:03.056268 run-command.c:343 trace: run_command: 'D:\tools\Git\mingw64\libexec\git-core\git-daemon.exe' '--serve' '--reuseaddr' '--verbose' '--base-path=D:\git' '--export-all' '--enable=receive-pack'
[6492] Connection from 10...:54729
[6492] Extended attributes (27 bytes) exist
[6492] Request upload-pack for '/repo.git'
09:00:03.087469 run-command.c:343 trace: run_command: 'upload-pack' '--strict' '--timeout=0' '.'
[6492] 09:00:03.134269 git.c:561 trace: exec: 'git-upload-pack' '--strict' '--timeout=0' '.'
[6492] 09:00:03.134269 run-command.c:343 trace: run_command: 'git-upload-pack' '--strict' '--timeout=0' '.'
[6492] 09:00:03.617872 run-command.c:343 trace: run_command: 'pack-objects' '--revs' '--thin' '--stdout' '--progress' '--delta-base-offset'
What else can I try?

Git daemon is known to work on Windows only when some text is selected
in git daemon's console window (e.g., see
git clone fails with "index-pack" failed?).
This text selection delays daemon's output, which somehow helps (!). As
soon as text selection is cleared (with Escape key), cloning/fetching
fails most of the time. Select text again, and cloning/fetching resumes
to work. The problem can be easily reproduced on Windows 10 using git
2.11.0.windows.1 by cloning locally via
git clone git://127.0.0.1/my-repo.

I have found another solution, only start the **git-daemon.exe directly** e.g.
For the 64bit git:
"C:\Program Files\Git\mingw64\libexec\git-core\git-daemon.exe"
--> with the same paramters as git.exe.
Then it works without the selection text.

Related

push to Azure DevOps git repo: GCM: NullReferenceException

I installed GCM (Git Credential Manager) on my Windows OS. Using it I can push to GitLab and Bitbucket repositories, successfully. But about Azure DevOps:
>git push Azure master
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
Then prompt for username (independent of GCM).
With trace:
>SET GIT_TRACE=1
>SET GCM_TRACE=1
>git push Azure master
17:34:02.362309 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
17:34:02.364307 git.c:415 trace: built-in: git push Azure master
17:34:02.370303 run-command.c:637 trace: run_command: GIT_DIR=.git git remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.382598 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:02.383601 git.c:671 trace: exec: git-remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.384601 run-command.c:637 trace: run_command: git-remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.399961 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:03.391539 run-command.c:637 trace: run_command: 'git credential-manager get'
17:34:03.613232 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:03.615233 git.c:671 trace: exec: git-credential-manager get
17:34:03.615233 run-command.c:637 trace: run_command: git-credential-manager get
17:34:03.698676 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.18.0) 'get'
17:34:03.793588 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s).
17:34:03.802579 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 38 entries.
17:34:03.809873 ...\Common.cs:543 trace: [LoadOperationArguments] useHttpPath = ''.
17:34:03.879804 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://mirismaili.visualstudio.com/OpenLib/_git/Android'.
17:34:04.749863 ...uthentication.cs:229 trace: [DetectAuthority] detected 'https://mirismaili.visualstudio.com/' as Azure DevOps from GET response.
17:34:04.757022 ...\Program.cs:601 trace: [Run] ! error: 'Object reference not set to an instance of an object.'.
17:34:04.760018 ...\Common.cs:709 trace: [LogEvent] System.NullReferenceException: Object reference not set to an instance of an object.
at AzureDevOps.Authentication.Authentication.<DetectAuthority>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AzureDevOps.Authentication.Authentication.<GetAuthentication>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<CreateAuthentication>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<QueryCredentials>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<<Get>b__24_0>d.MoveNext()
17:34:04.769048 ...\Program.cs:601 trace: [Run] fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
17:34:04.793392 run-command.c:637 trace: run_command: bash -c 'test "a$SHELL" '\!'= "a${SHELL%.exe}" || exit 127; cat >/dev/tty && read -r line </dev/tty && echo "$line"'
Other useful information:
>git remote -v
Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android (fetch)
Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android (push)
BitBucket https://mirismaili#bitbucket.org/mirismaili/androidopenlib.git (fetch)
BitBucket https://mirismaili#bitbucket.org/mirismaili/androidopenlib.git (push)
GitLab https://mirismaili#gitlab.com/OpenLib/android.git (fetch)
GitLab https://mirismaili#gitlab.com/OpenLib/android.git (push)
>git version
git version 2.19.1.windows.1
>git credential-manager version
Git Credential Manager for Windows version 1.18.0
>git config -l
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslbackend=schannel
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
core.editor='C:\Program Files\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin
user.name=S. Mahdi Mir-Ismaili
user.email=s.m.mirismaili#gmail.com
gui.recentrepo=D:/I/Documents/CryptoCurrenciesSimulator
credential.usehttppath=true
credential.helper=manager
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.Azure.url=https://mirismaili.visualstudio.com/OpenLib/_git/Android
remote.Azure.fetch=+refs/heads/*:refs/remotes/Azure/*
branch.master.remote=BitBucket
branch.master.merge=refs/heads/master
remote.BitBucket.url=https://mirismaili#bitbucket.org/mirismaili/androidopenlib.git
remote.BitBucket.fetch=+refs/heads/*:refs/remotes/BitBucket/*
remote.GitLab.url=https://mirismaili#gitlab.com/OpenLib/android.git
remote.GitLab.fetch=+refs/heads/*:refs/remotes/GitLab/*
Another note is that I can push to Azure remote, with Visual Studio Team Services plugin for IntelliJ IDEs.
I updated GCM from v1.18.0 to v1.18.2 and the problem solved:
I think it was relevant to this BugFix on v1.18.1:
Fixes Null Reference exceptions when parameters or contentType are not populated
Hy
I had the same problem with all of my Azure-DevOps-Repos since today.
I believe this refers to the change from Visual Studio Team Services to DevOps.
My workaround was following:
I reconfigured GIT to save credentials:
git config --global credential.helper store
I signed in my DevOps-Account and created a new personal access token
I opened one of my repos and executed another fetch
After the NullReferenceException prompt, I entered my username and pasted the created access token inside the password prompt.
Now, on each interaction with the remote i get two NullReferenceException-Prompts but it works now for all of my Azure-DevOps-Repos...
I don't know how this will behave with other Repo-Services like GitHub and so on. I do only use Azure...
This is only a quik and dirty workaround. So I would appreciate if someone could share a better solution.
Thanks

Git interactive commands fail to complete with message "The system cannot find the path specified" on MinGw64

I'm trying to perform git add --patch -- <file> and the command never completes. The MINGW64 shell just displays "The system cannot find the path specified."
When narrowing down the cause by setting GIT_TRACE=1 and trying to run some of the component commands, I found that the error is caused by the --interactive option and the same effect is seen no matter what git command is being run.
Setting GIT_TRACE=1 on the following interactive command gives the output shown:
$ GIT_TRACE=1 git add --interactive -- .gitignore
19:16:47.185964 git.c:350 trace: built-in: git 'add' '--interactive' '--' '.gitignore'
19:16:47.185964 run-command.c:336 trace: run_command: 'add--interactive' '--' '.gitignore'
19:16:47.215964 git.c:564 trace: exec: 'git-add--interactive' '--' '.gitignore'
19:16:47.215964 run-command.c:336 trace: run_command: 'git-add--interactive' '--' '.gitignore'
19:16:47.345964 git.c:350 trace: built-in: git 'rev-parse' '--git-dir'
19:16:47.375964 git.c:350 trace: built-in: git 'rev-parse' '--show-prefix'
19:16:47.405964 git.c:350 trace: built-in: git 'config' '--get-colorbool' 'color.interactive' 'false'
19:16:47.436965 git.c:350 trace: built-in: git 'config' '--get-colorbool' 'color.diff' 'false'
19:16:47.466965 git.c:350 trace: built-in: git 'config' '--get-color' 'reset'
19:16:47.496965 git.c:350 trace: built-in: git 'config' '--get' 'diff.algorithm'
19:16:47.546965 git.c:350 trace: built-in: git 'config' '--bool' '--get' 'diff.compactionheuristic'
19:16:47.576965 git.c:350 trace: built-in: git 'config' '--get' 'interactive.difffilter'
19:16:47.606965 git.c:350 trace: built-in: git 'config' '--bool' '--get' 'interactive.singlekey'
19:16:47.636965 git.c:350 trace: built-in: git 'rev-parse' '--git-dir'
19:16:47.666965 git.c:350 trace: built-in: git 'update-index' '--refresh'
19:16:47.793965 git.c:350 trace: built-in: git 'ls-files' '--' '.gitignore'
The system cannot find the path specified.
19:16:47.843965 git.c:350 trace: built-in: git 'diff-index' '--cached' '--numstat' '--summary' '4b825dc642cb6eb9a060e54bf8d69288fbee4904' '--' '.gitignore'
19:16:47.873966 git.c:350 trace: built-in: git 'diff-files' '--numstat' '--summary' '--raw' '--' '.gitignore'
Trying to add the file without the interactive option works as expected. The operation only fails when there is an interactive (or patch) option added.
Note that I initially had the following issue when trying to run the command:
Can't locate Git.pm in #INC (you may need to install the Git module) (#INC contains: /mingw64/share/perl5/site_perl D:/Apps/StrawberryPerl/perl/site/lib D:/Apps/StrawberryPerl/perl/vendor/lib D:/Apps/StrawberryPerl/perl/lib) at C:\Program Files\Git\mingw64/libexec/git-core\git-add--interactive line 7.
BEGIN failed--compilation aborted at C:\Program Files\Git\mingw64/libexec/git-core\git-add--interactive line 7.
However after copying the Git.pm and Error.pm modules to the perl include folder, the problem changed to the one described at the top of this question.
Finally, as a further attempt at figuring this out I ran the command in a Windows command prompt (cmd.exe) and had a totally different error:
c:\code\proj>git add --patch .gitignore
error: wrong number of arguments
usage: git config [<options>]
Config file location
--global use global config file
--system use system config file
--local use repository config file
-f, --file <file> use given config file
--blob <blob-id> read config from given blob object
Action
--get get value: name [value-regex]
--get-all get all values: key [value-regex]
--get-regexp get values for regexp: name-regex [value-regex]
--get-urlmatch get value specific for the URL: section[.var] URL
--replace-all replace all matching variables: name value
[value_regex]
--add add a new variable: name value
--unset remove a variable: name [value-regex]
--unset-all remove all matches: name [value-regex]
--rename-section rename section: old-name new-name
--remove-section remove a section: name
-l, --list list all
-e, --edit open an editor
--get-color find the color configured: slot [default]
--get-colorbool find the color setting: slot [stdout-is-tty]
Type
--bool value is "true" or "false"
--int value is decimal number
--bool-or-int value is --bool or --int
--path value is a path (file or directory name)
Other
-z, --null terminate values with NUL byte
--name-only show variable names only
--includes respect include directives on lookup
--show-origin show origin of config (file, standard input, blob, command line)
config --get-color color.interactive.prompt bold blue: command returned error: 129
I checked my git config files and I don't set this option so I'm guessing it's a default that's set somewhere.
Apart from the obvious aspect of the question (i.e. getting the --interactive or --patch options to work as expected), I'd also appreciate any advice or tips on debugging this further. The various TRACE options I used didn't really highlight where the problem was, apart from showing me that it was the --interactive option that was the issue.
In short - the answer here was to upgrade the version of Git for Windows used. My version was 2.10.1.windows.1 which is a couple of years old. I upgraded to 2.19.0.windows.1 and all is now working as it should.
So the issue might be because there was an error in that version of git, in which case hopefully this will give anyone else using that version a heads-up. Alternatively, there could have been an issue with my installation somewhere along the line, which was automatically corrected by the new git installation. In that case, consider this an idea of things to try if you are having similar problems.
Not a particularly fulfilling answer - but an answer nonetheless.

error: git-credential-osxkeychain died of signal 11 - can't understand answers

I am trying to push a text file to github and am getting the above error. I am using OSX 10.7.5 and git-1.8.4.2.
I have created a text file which I seem to be able to add and commit without problems. On my first attempt, I had the following error message:
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
error: `git-credential-osxkeychain died of signal 11`
Username for `'https://github.com'`: Anto58
Password for `'https://Anto58#github.com'`:
error: `git-credential-osxkeychain` died of signal 11
To `https://github.com/Anto58/datasciencecoursera.git`
! [rejected] master -> master (fetch first)
error: failed to push some refs to `'https://github.com/Anto58/datasciencecoursera.git'`
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I spent some time researching this and found that this was a problem because my github repo had a readme file in it that was not on my local repo and I tried implementing both suggested solutions, cloning and pulling before pushing.
The cloning looked as though it was working:
Cloning into 'coursera-repo'...
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
Checking connectivity... done
But I still couldn't push. So then I deleted my directory and started again using pull, which gave virtually identical output:
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From `https://github.com/Anto58/datasciencecoursera`
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
But same problem with pushing:
error: `git-credential-osxkeychain` died of signal 11
Username for `'https://github.com'`: Anto58
Password for `'https://Anto58#github.com'`:
error: `git-credential-osxkeychain` died of signal 11
Everything up-to-date
While it said everything was up-to-date, the file did not appear in my github'repo`.
Then I found the link on the stackoverflow question which had the link to the site dealing with caching your github password, which I tried to follow.
I typed
git credential-osxkeychain
which gave me the same error as I started with
I then tried to download the osxkeychain helper using the curl command:
`curl -s -O \
? https://github-media-downloads.s3.amazonaws.com/osx/git-dredential-osxkeychain`
I didn't get an error message for this, so I'm assuming it worked?
The next step was changing the permissions:
chmod u+x git-credential-osxkeychain
which again didn't give an error message
But I fell over at the next step:
sudo mv git-credential-osxkeychain \
"$(dirname $(which git))/git-credential-osxkeychain"`
where I got an illegal variable name message. Is this because dirname should actually be /user/local/git/? And should "which git" also be replaced by something else? I started getting pretty nervous at the point when I got the message:
`WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.`
because I really had no idea what I was doing.
The TA on Coursera suggested just running
git config --global credential.helper osxkeychain
but now I get the error message twice instead of just once and still can't push.
I have also tried to find where my gitconfig file is since one of the suggestions is to delete your gitconfig file but only after checking it doesn't have anything else in it. It didn't show up on a normal search in finder so I assumed it is hidden and used defaults write com.apple.finder AppleShowAllFiles YES but without success. When I use alt Relaunch, Finder keeps opening with the Git package window that doesn't have a search option.
Sorry this is so long - Can anybody help me and explain what I need to do in very simple terms - assume I know nothing?
Also if you can explain why that would be incredibly helpful as I would like to understand how it works.
I am using the same Mac operating system and Git version as you and have been getting the same error messages when trying to push the HelloWorld.md file to my datasciencecoursera repo on Github. I finally got round this by deleting the repo on Github and making it again but without ticking the create README file, so its just a completely empty repository. I then deleted and recreated the directory I'd made on my local computer, remade the HelloWorld file and followed the course instructions again for initiating and linking the local/Github repositories and pushing the file to GitHub. The final command that worked for me was one the options suggested by GitHub when I set up the repo: git push -u origin master (after linking to the local repository). I still got the error messages, and got asked for my user name and password. I entered these (note that the password does not show up when you type it in...) and then got the error messages again but followed by detail:
error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11
Counting objects: 3, done.
Writing objects: 100% (3/3), 244 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/keh444/datasciencecoursera.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
When I looked on GitHub the HelloWorld file was in the repo, so it had worked.
While this may not have solved the problem in the long term at least I can now move on...

I have a Git repository. I have cloned the repository,Commited my local changes. When I push my changes to the server it shows error

when i pull the chages from clone, it is reflected in server and vice versa. but when i push it shows error.
Error message:
git.exe push --progress "origin" master:master
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 474 bytes | 0 bytes/s, done.
Total 6 (delta 3), 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 inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
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 //INCHNLRDFS06/CUB Ebanking$/GIT_Ebank
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '//INCHNLRDFS06/CUB Ebanking$/GIT_Ebank'
git did not exit cleanly (exit code 1) (1029 ms # 9/10/2014 6:43:09 PM)
If you are cloning from another user's repository, the origin remote (assuming you're pushing to origin) is linked to that user's repo.
In order to commit and push your changes, you first must fork that user's repo and clone from your fork. Doing so will set up your remote to your repo and you can commit and push as you please.
You can view your remotes in the .git/config file and correct them if you're still having trouble.

GitHub for Mac throw a Git Error when I clicked the Publish button

Like the Title, it throw me a Git Error message:
2013-06-08 13:51:35.249 GitHub for Mac Login[1883:707] AskPass with
arguments: (
"/Applications/GitHub.app/Contents/MacOS/GitHub for Mac Login",
"root#192.168.1.107's password: " )
2013-06-08 13:51:35.285 GitHub for Mac Login[1883:707] Error reading
attributes for password: OSStatus 840183217
Counting objects: 3, done.
Writing objects: 33% (1/3)
Writing objects: 66% (2/3)
Writing objects: 100% (3/3)
Writing objects: 100% (3/3), 215 bytes, done.
Total 3 (delta 0), 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 inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
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 root#192.168.1.107:/var/www/html/repository/ ! [remote rejected]
master -> master (branch is currently checked out) error: failed to
push some refs to 'root#192.168.1.107:/var/www/html/repository/' (1)
I'm a beginner of use git to control the program version, and I find something like GitHub for Mac to use easily.
What I should be in the linux server configuration?
I find some useful from
http://rogerdudler.github.io/git-guide/
How to publish files to my server?
Thank you!
The error message says that you are trying to push to a non-bare repository, i.e. a normal repository rather than one that was created (with git init --bare) to enable it to function easily as a "central" repository that can be pushed to.
If you want more guidance on how to get started with git, take a look at the question
Git for beginners: The definitive practical guide

Resources