Git Pull执行完全卡住(Git 2.13.5/Apple Git-94)求助
git pull in Git 2.13.5 (Apple Git-94) Hey there, let’s work through this stuck git pull issue you’re facing. Older Apple-distributed Git versions like 2.13.5 (Git-94) can have quirky behavior with connections or local state, so here’s a step-by-step approach to fix it:
1. First, terminate the stuck Git process
If git pull is frozen, hit Ctrl+C to kill the running command. If that doesn’t work, open a new terminal window and run:
ps aux | grep git
Look for the git pull or related Git processes, note their PID numbers, then terminate them with:
kill <PID_NUMBER>
2. Diagnose the root cause with verbose fetch
git pull combines git fetch and git merge, so isolating the fetch step can tell you if the issue is network-related or a merge problem. Run:
git fetch --verbose
- If this hangs too: The problem is likely a network connection issue with your remote repository.
- If this completes successfully: The issue is with the merge step, which we’ll address later.
3. Fix network connection issues
If git fetch hangs, try these checks:
- Test SSH connectivity (if you use SSH for repo access):
You should get a friendly confirmation message if the connection works. If not, check your SSH keys or firewall settings.ssh -T git@<YOUR_REPO_HOST> # e.g., git@github.com - Check for proxy interference: Older Git versions can misbehave with proxies. Run these commands to see if a proxy is configured:
If output returns a proxy URL, unset them temporarily:git config --global --get http.proxy git config --global --get https.proxygit config --global --unset http.proxy git config --global --unset https.proxy - Test HTTPS connectivity (if using HTTPS):
This will show you if the remote server is reachable and if there are SSL or redirect issues.curl -v https://<YOUR_REPO_URL>
4. Resolve merge-related hangs
If git fetch works but git pull still hangs, the issue is likely with the merge step:
- Run merge manually: Instead of using
git pull, execute the two steps separately:
If there are merge conflicts, Git will prompt you to resolve them instead of hanging.git fetch origin git merge origin/<YOUR_BRANCH_NAME> # e.g., origin/main - Check for stale lock files: Sometimes a previous failed operation leaves a lock file. Delete it with:
rm -f .git/index.lock
5. Clean up local Git state
Older Git versions can accumulate stale objects that cause hangs. Run this to clean up:
git gc --prune=now
This removes unreachable objects, optimizes the repository, and clears cached connections.
6. Consider upgrading Git (optional but recommended)
Apple’s bundled Git 2.13.5 is quite outdated (released in 2017). Many connectivity and stability issues have been fixed in newer versions. If you can, install a newer Git via Homebrew:
brew install git
Then verify the new version is active:
git --version
Start with the earliest steps and work your way down—most stuck git pull issues in this version are either network-related or stale local state problems.
内容的提问来源于stack exchange,提问作者Abraham Gnanasingh

