Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
545 views
in Technique[技术] by (71.8m points)

changes not reflecting at git server

I have installed Git and configured it as server in CentOS and Windows as client machine.

And then I made one repo and tried to push changes but failed with error updating the current branch in a non-bare repository is denied and after google search I came to know git config receive.denyCurrentBranch ignore

Then I tried again pushing the changes

  ~/Documents/GitHub/Proj02 (master)
$ git push origin master
Warning: Permanently added '192.168.56.102' (RSA) to the list of known hosts.
[email protected]'s password:
Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 229 bytes | 0 bytes/s, done.
Total 2 (delta 1), reused 0 (delta 0)
To ssh://[email protected]:/home/git/Proj02/
   75a8cb9..484d414  master -> master
~/Documents/GitHub/Proj02 (master)

But I am unable to see the changes at Remote server

[git@centos Proj02]$ git config receive.denyCurrentBranch ignore
[git@centos Proj02]$ ls

Note : Then after I dont see changes at server , so I created one folder in the server repo and push the changes and from the stdout I saw the changes that the files I pushed from client , they got deleted and the recent changes that I was pushed got submitted.

And I am trying to implement a Git server.

How can I see the changes I just pushed?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Make sure that:

  • your server has git 2.3+
  • you have set on that server:

     git config --global receive.denyCurrentBranch updateInstead
    

(See "Push to a non-bare Git repository")

Make sure first that your repo on the server is not a bare repo.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...