{"id":6407,"date":"2022-05-11T16:03:18","date_gmt":"2022-05-11T08:03:18","guid":{"rendered":"http:\/\/xinyiworld.top\/wordpress\/?p=6407"},"modified":"2024-04-11T15:29:27","modified_gmt":"2024-04-11T07:29:27","slug":"git%e9%97%ae%e9%a2%98%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=6407","title":{"rendered":"Git\u95ee\u9898\u603b\u7ed3"},"content":{"rendered":"<ul>\n<li>\n<p>Git: There is no tracking information for the current branch.<br \/>\n<a href=\"https:\/\/blog.csdn.net\/sinat_36246371\/article\/details\/79738782\">https:\/\/blog.csdn.net\/sinat_36246371\/article\/details\/79738782<\/a><\/p>\n<\/li>\n<li>\n<p>\u5f53\u524d\u5206\u652f\u6ca1\u6709\u8ddf\u8e2a\u4fe1\u606f\u3002\u8bf7\u6307\u5b9a\u60a8\u8981\u5408\u5e76\u54ea\u4e00\u4e2a\u5206\u652f\u3002<br \/>\ngit pull\u65f6\u63d0\u793a\u4e0a\u9762\u9519\u8bef\uff0c\u7531\u4e8e\u672c\u5730\u6ca1\u6709\u4efb\u4f55\u5206\u652f\uff0c\u9700\u8981git checkout -b master origin\/master\uff0c\u5c06\u8fdc\u7a0b\u5206\u652f\u68c0\u51fa\u3002<\/p>\n<\/li>\n<li>\n<p>git branch\u67e5\u770b\u4e0d\u5230\u5206\u652f\u4fe1\u606f<br \/>\n\u9700\u8981\u5148commit<br \/>\n<a href=\"https:\/\/blog.csdn.net\/weixin_43213984\/article\/details\/107102231\">https:\/\/blog.csdn.net\/weixin_43213984\/article\/details\/107102231<\/a><\/p>\n<\/li>\n<li>\n<p>git \u5ffd\u7565\u6587\u4ef6\u65e0\u6548<br \/>\n<a href=\"https:\/\/cloud.tencent.com\/developer\/article\/1874703\">https:\/\/cloud.tencent.com\/developer\/article\/1874703<\/a><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"language-bash\">git rm -r --cached .\ngit add .\ngit commit -m &#039;update .gitignore&#039;<\/code><\/pre>\n<ul>\n<li>git fatal: \u62d2\u7edd\u5408\u5e76\u65e0\u5173\u7684\u5386\u53f2\u7684\u9519\u8bef\u89e3\u51b3<\/li>\n<\/ul>\n<pre><code class=\"language-bash\">\u672c\u5730\u521d\u59cb\u5316\u7684\u9879\u76ee \u4e0e github \u7248\u672c\u4e0d\u4e00\u81f4, \u5bfc\u81f4\u65e0\u6cd5\u63d0\u4ea4\n\n$ git pull origin master\n * branch            master     -&gt; FETCH_HEAD\nfatal: \u62d2\u7edd\u5408\u5e76\u65e0\u5173\u7684\u5386\u53f2\n\u89e3\u51b3\u65b9\u6cd5\n\n\u5728pull \u65f6\u5019, \u6dfb\u52a0\u2013allow-unrelated-histories\u53c2\u6570 \u5373\u53ef.\n\n$ git pull origin master --allow-unrelated-histories                   \n\u6765\u81ea https:\/\/github.com\/itaken\/python-login-demo\n * branch            master     -&gt; FETCH_HEAD\nMerge made by the &#039;recursive&#039; strategy.\n LICENSE | 21 +++++++++++++++++++++\n 1 file changed, 21 insertions(+)\n create mode 100644 LICENSE<\/code><\/pre>\n<ul>\n<li>git add \u63d0\u793a\u5f02\u5e38LF would be replaced by CRLF<br \/>\n<a href=\"https:\/\/www.cnblogs.com\/erlangha\/p\/15617125.html\">https:\/\/www.cnblogs.com\/erlangha\/p\/15617125.html<\/a><\/li>\n<\/ul>\n<p><code>git config --global core.autocrlf false<\/code><\/p>\n<ul>\n<li>\n<p>idea\u7cfb\u5217\u7684git\u63d0\u4ea4\u65f6\u63d0\u793achecks failed<br \/>\n<a href=\"https:\/\/blog.csdn.net\/qq_46548855\/article\/details\/126506747\">https:\/\/blog.csdn.net\/qq_46548855\/article\/details\/126506747<\/a><br \/>\n\u5230commit\u7684\u7a97\u53e3\u7684\u8bbe\u7f6e\u7a97\u53e3\u91cc\u53d6\u6d88check todo\u7684\u52fe\u9009<\/p>\n<\/li>\n<li>\n<p>\u81f4\u547d\uff1a\u62d2\u7edd\u5408\u5e76\u4e0d\u76f8\u5173\u7684\u5386\u53f2\u8bb0\u5f55<br \/>\n<code>--allow-unrelated-historiesgit <\/code>\u5c06\u8be5\u6807\u5fd7\u9644\u52a0\u5230 <code>command git pull origin master<\/code><\/p>\n<\/li>\n<li>\n<p>fatal: loose object<br \/>\n<a href=\"https:\/\/geek-docs.com\/git\/git-questions\/633_git_how_to_remove_fatal_loose_object.html\">https:\/\/geek-docs.com\/git\/git-questions\/633_git_how_to_remove_fatal_loose_object.html<\/a><\/p>\n<\/li>\n<li>\n<p>\u677e\u6563\u5bf9\u8c61\u5df2\u635f\u574f<br \/>\n<a href=\"https:\/\/www.cnblogs.com\/huxiaofeng1029\/p\/17436594.html\">https:\/\/www.cnblogs.com\/huxiaofeng1029\/p\/17436594.html<\/a><br \/>\n\u6ca1\u6709\u8bd5\u6210\u529f\uff0c\u5efa\u8bae\u5907\u4efd\u539f\u9879\u76ee\u518d\u64cd\u4f5c\uff0c\u6216\u8005\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u91cd\u65b0clone\u9879\u76ee\u3002<\/p>\n<\/li>\n<li>\n<p>\u66f4\u65b0\u88ab\u62d2\u7edd\uff0c\u56e0\u4e3a\u60a8\u5f53\u524d\u5206\u652f\u7684\u6700\u65b0\u63d0\u4ea4\u843d\u540e\u4e8e\u5176\u5bf9\u5e94\u7684\u8fdc\u7a0b\u5206\u652f<\/p>\n<pre><code class=\"language-bash\">git remote add origin https:\/\/github.com\/miaoihan\/weibo.git  \n$git fetch origin    \/\/\u83b7\u53d6\u8fdc\u7a0b\u66f4\u65b0\n$git merge origin\/master \/\/\u628a\u66f4\u65b0\u7684\u5185\u5bb9\u5408\u5e76\u5230\u672c\u5730\u5206\u652f<\/code><\/pre>\n<\/li>\n<\/ul>\n<button class=\"simplefavorite-button\" data-postid=\"6407\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>Git: There is no tracking information for the curr [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[358],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/6407"}],"collection":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6407"}],"version-history":[{"count":12,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/6407\/revisions"}],"predecessor-version":[{"id":12993,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/6407\/revisions\/12993"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6407"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}