{"id":367,"date":"2026-10-13T22:41:09","date_gmt":"2026-10-13T22:41:09","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2014\/08\/18\/git-troubleshooting\/"},"modified":"2026-10-13T22:41:09","modified_gmt":"2026-10-13T22:41:09","slug":"git-troubleshooting","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/git-troubleshooting\/","title":{"rendered":"Git Troubleshooting for Slow or Hanging Commands: Tracing, Verbose Logs, and Safer Diagnostics"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>Originally published on 2014-08-18; fully revised and updated.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If Git commands like <code>clone<\/code> or <code>push<\/code> seem slow, stuck, or silent, enabling Git\u2019s built-in tracing is often the fastest way to see what is happening. This guide is for developers and DevOps engineers who need a repeatable way to collect useful diagnostics and narrow down whether the issue is local config, network transport, or remote server behavior.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2014\/08\/git-troubleshooting.png\" alt=\"Git troubleshooting\" width=\"600\" height=\"400\" \/><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Quick triage workflow for hanging Git commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use this sequence when a Git operation appears hung. It helps you capture diagnostics first, then make targeted changes.<\/p>\n\n\n\n<pre class=\"mermaid\">\nflowchart TD\n    A[Git command is slow or appears stuck] --> B[Re run with trace enabled]\n    B --> C[If HTTP or HTTPS remote add curl verbose]\n    C --> D[Capture output to a log file]\n    D --> E[Check remote URL auth and Git config]\n    E --> F{Issue resolved}\n    F -- Yes --> G[Run normally and remove debug vars]\n    F -- No --> H[Check network server and repo factors]\n    H --> I[Share logs with Git or platform admin]\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Debug options and what each one is for<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Option or command<\/th><th>Best for<\/th><th>How to use it<\/th><th>What you get<\/th><\/tr><\/thead><tbody><tr><td><code>GIT_TRACE=1<\/code><\/td><td>General command tracing<\/td><td>Prefix any Git command<\/td><td>Internal execution trace from Git<\/td><\/tr><tr><td><code>GIT_CURL_VERBOSE=1<\/code><\/td><td>HTTP or HTTPS transport issues<\/td><td>Prefix network commands like <code>push<\/code> or <code>clone<\/code><\/td><td>Verbose libcurl request and response details<\/td><\/tr><tr><td><code>-v<\/code> or <code>--verbose<\/code><\/td><td>Command-level verbosity<\/td><td>Add as a Git command flag<\/td><td>More command output, usually less detailed than full trace<\/td><\/tr><tr><td><code>git config --list<\/code><\/td><td>Configuration inspection<\/td><td>Run directly in repo or shell<\/td><td>Effective configuration values in scope<\/td><\/tr><tr><td><code>git config --global --get http.postBuffer<\/code><\/td><td>Check if <code>http.postBuffer<\/code> is set globally<\/td><td>Run directly in shell<\/td><td>Current configured value if present<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Practical command patterns<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The original post listed several useful snippets. The examples below normalize them into copy-paste-safe commands with standard double-dash flags.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\"><span class=\"hljs-comment\"># One-off trace for a clone<\/span>\nGIT_TRACE=<span class=\"hljs-number\">1<\/span> git <span class=\"hljs-keyword\">clone<\/span> &lt;repository-url&gt;\n\n<span class=\"hljs-comment\"># Verbose push with HTTP diagnostics<\/span>\nGIT_CURL_VERBOSE=<span class=\"hljs-number\">1<\/span> git push -u origin --all --verbose\n\n<span class=\"hljs-comment\"># Capture detailed push output to a file<\/span>\nGIT_TRACE=<span class=\"hljs-number\">1<\/span> GIT_CURL_VERBOSE=<span class=\"hljs-number\">1<\/span> git push --verbose <span class=\"hljs-number\">2<\/span>&gt;&amp;<span class=\"hljs-number\">1<\/span> | tee git-debug.log<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\"><span class=\"hljs-comment\"># Set for current shell session<\/span>\nexport GIT_CURL_VERBOSE=<span class=\"hljs-number\">1<\/span>\ngit push\n\n<span class=\"hljs-comment\"># Remove when done<\/span>\n<span class=\"hljs-keyword\">unset<\/span> GIT_CURL_VERBOSE<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\"><span class=\"hljs-comment\"># Inspect active Git configuration<\/span>\ngit config --<span class=\"hljs-keyword\">list<\/span>\n\n<span class=\"hljs-comment\"># Check whether this global key is set<\/span>\ngit config --<span class=\"hljs-keyword\">global<\/span> --get http.postBuffer<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">What to check before changing Git settings<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Verify the remote URL and protocol with <code>git remote -v<\/code>.<\/li><li>Reproduce the issue once with tracing enabled and save logs.<\/li><li>Confirm whether the issue affects only one repository or multiple repositories.<\/li><li>Check whether the problem is specific to HTTP\/HTTPS transport or SSH transport.<\/li><li>Avoid persistent config changes until diagnostics show a clear cause.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Original reference links<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These links were included in the original article and are preserved for further reading:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/github.com\/gitlabhq\/gitlab-public-wiki\/wiki\/Trouble-Shooting-Guide\">https:\/\/github.com\/gitlabhq\/gitlab-public-wiki\/wiki\/Trouble-Shooting-Guide<\/a><\/li><li><a href=\"https:\/\/drupal.org\/node\/1065850\">https:\/\/drupal.org\/node\/1065850<\/a><\/li><li><a href=\"http:\/\/mattberther.com\/2013\/12\/29\/pushing-large-git-repos-with-ssh\">http:\/\/mattberther.com\/2013\/12\/29\/pushing-large-git-repos-with-ssh<\/a><\/li><li><a href=\"http:\/\/ocaoimh.ie\/2008\/12\/10\/how-to-fix-ssh-timeout-problems\/\">http:\/\/ocaoimh.ie\/2008\/12\/10\/how-to-fix-ssh-timeout-problems\/<\/a><\/li><li><a href=\"http:\/\/unix.stackexchange.com\/questions\/3026\/what-do-the-options-serveraliveinterval-and-clientaliveinterval-in-sshd-conf\">http:\/\/unix.stackexchange.com\/questions\/3026\/what-do-the-options-serveraliveinterval-and-clientaliveinterval-in-sshd-conf<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Common pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Using typographic dashes (\u2013) instead of standard CLI dashes (<code>--<\/code>), which breaks commands.<\/li><li>Leaving debug environment variables enabled after troubleshooting.<\/li><li>Tweaking <code>http.postBuffer<\/code> without collecting trace logs first.<\/li><li>Troubleshooting from memory instead of sharing captured output with your Git platform admin.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When Git push or clone appears stuck, built-in trace flags can quickly reveal where execution is failing. This guide gives a practical workflow, command patterns, and common pitfalls for collecting actionable Git diagnostics.<\/p>\n","protected":false},"author":1,"featured_media":3414,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[38],"tags":[160,1595,1596,1597,255,1028,1509,1594,1593,293],"class_list":["post-367","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-git","tag-git-issues","tag-git-problems","tag-git-troubleshoot","tag-issues","tag-problems","tag-resolve","tag-solutions","tag-techniques","tag-troubleshooting"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=367"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/367\/revisions"}],"predecessor-version":[{"id":79244,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/367\/revisions\/79244"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3414"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}