问题
touch test
git add test
git commit -m "test"
git push -u origin master
This worked. The file was uploaded to the repository.
rm test
cp -R ../website ./website
git rm test
git add website/
git commit -m "Initial"
git push -u origin master
This did not give any output, and nothing seems to have bee done to the repository. The test file is still present in the repository.
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
Can anyone assist?
Recreated the branch on both client and server, to no succes. It works when there's just one file inside, but it will simply not push the website folder to the server.
This is the only strange thing I can see; POST git-receive-pack (chunked)
回答1:
Looks like this is something to do with BitBucket. Another question here had the same issue: Hanging at "POST git-receive-pack (chunked)"
The solution is to use Git+SSH rather than HTTP. It seems to only affect repos with files over a few megabytes.
回答2:
This does not look like a git error to me. If you are using exactly the commands you have shown, the contents of the ../website directory will not be copied to the ./website directory. Try doing a cp -R ../website ./website to copy all the contents.
Also, try doing a git status after copying to see if the changes reflect. Try adding everything in the repository directory to the git repo by doing git add .
Let me know the results of this operation. Also, I would appreciate it if you can update the question with your directory structure.
回答3:
Simply try git push, you don't need to specify arguments, as you already used -u option once. Also from your output it seems that Bitbucket server could be down at that moment.
回答4:
One common cause of this is if you enter the wrong passphrase for your SSH key. Until you clear the cached credentials, git push will never work with that remote.
The command line git push origin master will do nothing, stalled, and produce no output.
SmartGit can 'cause' this by auto-filling the wrong password for your SSH key during the push. Clicking OK permanently breaks 'git push' until you go into Preferences and clear that credential out.
回答5:
If you use persistent SSH connections, a stale connection could be the issue. It happened to me the first time today after a year of using persistent SSH. Open your .ssh/config and check the ControlPath, then go there and remove the corresponding file. For me it was /tmp/git@bitbucket.org:22
来源:https://stackoverflow.com/questions/12545861/git-push-no-output-nothing-happens