I have recently set up a VPS with Vultr and set up a remote git repository to upload my project.
After I add the remote to my local project and try to do the first push to it, it hangs after showing "Total 119 (delta 9), reused 0 (delta 0)".
To give a bit of context:
Here is part of the verbose ssh output on git push (after it has verified the ssh keys):
debug3: send packet: type 50
debug3: receive packet: type 52
debug1: Authentication succeeded (publickey).
Authenticated to 45.63.116.43 ([45.63.116.43]:22).
debug2: fd 4 setting O_NONBLOCK
debug2: fd 5 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: receive packet: type 91
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x08
debug2: client_session2_setup: id 0
debug1: Sending command: git-receive-pack '/var/repo/hc-teaser.git'
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
Counting objects: 119, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (104/104), done.
Writing objects: 100% (119/119), 277.89 KiB | 5.91 MiB/s, done.
Total 119 (delta 9), reused 0 (delta 0)
debug2: channel 0: read<=0 rfd 4 len 0
debug2: channel 0: read failed
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug3: send packet: type 96
debug2: channel 0: input drain -> closed
debug2: channel 0: rcvd adjust 65689
After this last line it just hangs indefinitely.
The issue was bad target folder permissions. When I created the target folder, I used "sudo", so the owner was set to root. When I changed the target folder owner to my user (the one used to push the repo) and the group to www-data, everything worked like a charm.
So I've learnt that when git can't move the files from your repo to the target folder, because it doesn't have the proper authorisation, it doesn't show any error report, it just waits indefinitely.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.