I am uisng sourcetree 188.8.131.52 on Win10. I have created a GIT repository on a local NAS as a file set. Then clone this to local workspace on my C drive. Update the content on local repsository C drive ... commit .... then push back to the repository on ther NAS. I get the following error ...
"git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin master:master
Pushing to O:\GIT\GV-TDMA\PSU-IO Board\EaglePCB
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."
If I do the same process but using Bitbucket to host the remote repository it all works OK ....
Whats wrong .... ????
Any help appreciated
Your NAS isn't really setup as a real git server.
To get rid of this error go to the folder on the NAS and run this command in terminal:
git config receive.denyCurrentBranch ignore
Now you can push to the file server without seeing that message.
It is best to have the repo on the NAS as a "bare" repo.
If you don't you'll have this other annoying problem if you open your NAS repo in SourceTree:
The “old” files on the server will be seen as “different” from the “latest” commit that you pushed to it. So it will think the “old” files are “new changes” that need to be commiteed. But they aren’t.
So what you have to then do is double click the latest commit in the history view and select discard changes. (remember the changes aren’t actually changes, they are the old files which are different because they are old.)
Doing that will make the contents of the folder match the latest branch with the exception of any files that were deleted in the latest commit. Those files will remain and will show up as untracked. Just delete them manually.
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG