{"id":107,"date":"2014-05-20T01:40:39","date_gmt":"2014-05-20T01:40:39","guid":{"rendered":"http:\/\/vkrastev1blog.com\/?p=107"},"modified":"2014-05-20T01:43:24","modified_gmt":"2014-05-20T01:43:24","slug":"important-git-commands","status":"publish","type":"post","link":"https:\/\/vkrastev1blog.com\/2014\/05\/20\/important-git-commands\/","title":{"rendered":"\u91cd\u8981\u7684 Git \u547d\u4ee4\u548c\u6559\u7a0b"},"content":{"rendered":"<p>\u5982\u4f55\u83b7\u53d6 Git \u547d\u4ee4\u7684\u5e2e\u52a9<\/p>\n<p><em>git \u5e2e\u52a9<\/em> [-a|&#8211;all|-i|&#8211;info|-m|&#8211;man|-w|&#8211;web] [COMMAND]<\/p>\n<p>\u793a\u4f8b\uff1agit \u5e2e\u52a9 git<\/p>\n<p>\u5b83\u4f1a\u542f\u52a8\u6d4f\u89c8\u5668\u5e76\u663e\u793a HTML \u683c\u5f0f\u7684\u5e2e\u52a9\u3002<\/p>\n<p>\u8bbe\u7f6e\u672c\u5730\u5b58\u50a8\u5e93\u5e76\u8fdb\u884c\u521d\u59cb\u63a8\u9001\uff1a<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">cd my_project\r\ngit init\r\ngit add <span class=\"token operator\">*<\/span>\r\ngit commit <span class=\"token operator\">-<\/span>m <span class=\"token string\">\"My initial commit message\"<\/span>\r\ngit remote add origin git@example<span class=\"token punctuation\">.<\/span>com<span class=\"token punctuation\">:<\/span>my_project<span class=\"token punctuation\">.<\/span>git\r\ngit push <span class=\"token operator\">-<\/span>u origin master<\/code><\/pre>\n<p>\u7b7e\u51fa\u5b58\u50a8\u5e93<\/p>\n<pre><code>git clone git:\/\/github.com\/schacon\/grit.git<\/code><\/pre>\n<p>\u8981\u5c06\u66f4\u6539\u63d0\u4ea4\u5230\u672c\u5730\u5b58\u50a8\u5e93\uff0c\u53ea\u9700\u6dfb\u52a0\u5373\u53ef\uff0c\u800c\u4e0d\u662f\u63d0\u4ea4\u3002\u5982\u679c\u60a8\u60f3\u5c06\u672c\u5730\u5206\u652f\/\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\uff0c\u53ea\u9700\u6267\u884c\u4e0b\u9762\u7684\u63a8\u9001\u547d\u4ee4\u3002<\/p>\n<pre>git add --all\r\n\r\ngit commit --all\r\n\r\ngit push\r\n<\/pre>\n<p>\u63a8\u9001\u5230\u5b58\u50a8\u5e93\u547d\u4ee4<\/p>\n<pre><code>git push &lt;remote&gt; &lt;local branch name&gt;:&lt;remote branch to push into&gt;<\/code>\r\ngit push [--all | --mirror | --tags] [--follow-tags] [-n | --dry-run] [--receive-pack=]\r\n           [--repo=] [-f | --force] [--prune] [-v | --verbose] [-u | --set-upstream]\r\n           [--force-with-lease[=[:]]]\r\n           [--no-verify] [ [\u2026]]\r\n<\/pre>\n<p>\u66f4\u591a\u547d\u4ee4\u53ef\u5728\u4ee5\u4e0b\u94fe\u63a5\u4e2d\u627e\u5230\u3002<\/p>\n<p>\u5305\u542b 20 \u4e2a\u547d\u4ee4\u7684\u65e5\u5e38 Git<\/p>\n<p><a href=\"https:\/\/www.kernel.org\/pub\/software\/scm\/git\/docs\/everyday.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/pub\/software\/scm\/git\/docs\/everyday.html<\/a><\/p>\n<p>\u597d\u7684 Git \u6559\u7a0b<\/p>\n<p>\u6559\u7a0b1\u5148\u5236\u4f5c-http:\/\/git-scm.com\/docs\/gittutorial<\/p>\n<p>\u6559\u7a0b2\u79d2\u5236\u4f5c &#8211; <a href=\"http:\/\/git-scm.com\/docs\/gittutorial-2.html\" rel=\"nofollow\">http:\/\/git-scm.com\/docs\/gittutorial-2.html<\/a><\/p>\n<p>\u8fdb\u4e00\u6b65\u6559\u7a0b &#8211; <a href=\"http:\/\/www.vogella.com\/tutorials\/Git\/article.html#firstgit_repostatus\" rel=\"nofollow\">http:\/\/www.vogella.com\/tutorials\/Git\/article.html#firstgit_repostatus<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u53d6\u5f97 Git \u6307\u4ee4 \u516c\u53f8\u7684\u516c\u53f8 git \u516c\u53f8 [-a|&#8211;all|-i|&#8211;info|-m|&#8211;man|-w|&#8211;web] [COMMAND] \u7bc4\u4f8b\uff1agit \u516c\u53f8 git \u5c07\u555f\u52d5\u700f\u89bd\u5668\u4e26\u986f\u793a HTML \u5f0f\u7684\u516c\u53f8\u3002 \u96fb\u8996\u5730\u5f71\u50cf\u5eab\u5e97\u4e86\u5be6\u65bd\u96fb\u5f71\u65b9\u6848\uff1a cd my_project git init git add * git commit -m &#8220;My initial commit message&#8221; [&hellip;]<\/p>\n","protected":false},"author":65283547,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Important Git commands and tutorials","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1017],"tags":[319,209196,29946263,32859840,81652472,19181762],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-1017","tag-commands","tag-git","tag-git-commands","tag-git-tutorial","tag-how-to-use-git","tag-using-git"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4CoHV-1J","jetpack-related-posts":[{"id":224,"url":"https:\/\/vkrastev1blog.com\/2022\/06\/01\/eclipse-problem-by-changing-git-password\/","url_meta":{"origin":107,"position":0},"title":"Eclipse\u66f4\u6539GIT\u5bc6\u7801\u95ee\u9898","author":"vkrastev2014","date":"01.06.2022","format":false,"excerpt":"I have had a problem by changing the GIT password in Eclipse. Eclipse could not change the password in the secure storage and I couldn't use GIT anymore. You schould do following: Eclipse go to Preferences -> General -> Security -> Secure storage and in Contents tab delete \"Default Secure\u2026","rel":"","context":"In &quot;\u722a\u54c7&quot;","block_context":{"text":"\u722a\u54c7","link":"https:\/\/vkrastev1blog.com\/category\/%e7%88%aa%e5%93%87\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":21,"url":"https:\/\/vkrastev1blog.com\/2014\/05\/09\/how-to-install-testdisk-on-ubuntu-and-to-add-universe-repository\/","url_meta":{"origin":107,"position":1},"title":"\u5982\u4f55\u5728 Ubuntu \u4e0a\u5b89\u88c5 testdisk \u5e76\u6dfb\u52a0 Universe \u5b58\u50a8\u5e93","author":"vkrastev2014","date":"09.05.2014","format":false,"excerpt":"Execute the command in console in Ubuntu. The commands are made for \u00a0Ubuntu 12.04 LTS (Precise Pangolin). For your Ubuntu Version replace \"precise\" in these commands with your Ubuntu Version name: sudo add-apt-repository \"deb http:\/\/us.archive.ubuntu.com\/ubuntu precise universe miltiverse\" sudo add-apt-repository \"deb http:\/\/us.archive.ubuntu.com\/ubuntu precise-updates universe miltiverse\" sudo apt-get update sudo apt-get\u2026","rel":"","context":"In &quot;\u5176\u4ed6\u7684&quot;","block_context":{"text":"\u5176\u4ed6\u7684","link":"https:\/\/vkrastev1blog.com\/category\/%e5%85%b6%e4%bb%96%e7%9a%84\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19,"url":"https:\/\/vkrastev1blog.com\/2014\/05\/09\/how-to-install-the-newest-nvidia-driver-on-ubuntu\/","url_meta":{"origin":107,"position":2},"title":"\u5982\u4f55\u5728 Ubuntu \u4e0a\u5b89\u88c5\u6700\u65b0\u7684 NVIDIA \u9a71\u52a8\u7a0b\u5e8f","author":"vkrastev2014","date":"09.05.2014","format":false,"excerpt":"Open console window and type following commands: -------------------------------------------------------------------------------------------------------------- sudo apt-add-repository ppa:ubuntu-x-swat sudo apt-get update sudo apt-get install nvidia-current --------------------------------------------------------------------------------------------------------------- And you have the newest Driver installed.","rel":"","context":"In &quot;\u5176\u4ed6\u7684&quot;","block_context":{"text":"\u5176\u4ed6\u7684","link":"https:\/\/vkrastev1blog.com\/category\/%e5%85%b6%e4%bb%96%e7%9a%84\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2,"url":"https:\/\/vkrastev1blog.com\/2014\/05\/09\/how-to-repair-bootloader-after-installing-ubuntu-on-preinstalled-windows-pc-als-second-operating-system\/","url_meta":{"origin":107,"position":3},"title":"\u5728\u9884\u88c5 Windows PC \u4f5c\u4e3a\u7b2c\u4e8c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5 Ubuntu \u540e\u5982\u4f55\u4fee\u590d Bootloader","author":"vkrastev2014","date":"09.05.2014","format":false,"excerpt":"I used this many times as the bootloader gone corrupted after the install and it was only possible to start in Linux but not in Windows after the Linux install. So you should do following to get it right. Execute following commands in Linux: ------------------------------------------------------------------------------------- sudo add-apt-repository ppa:yannubuntu\/boot-repair sudo apt-get\u2026","rel":"","context":"In &quot;\u5176\u4ed6\u7684&quot;","block_context":{"text":"\u5176\u4ed6\u7684","link":"https:\/\/vkrastev1blog.com\/category\/%e5%85%b6%e4%bb%96%e7%9a%84\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":247,"url":"https:\/\/vkrastev1blog.com\/2024\/04\/11\/how-to-create-pdf-from-html-or-image-using-java-pdfbox-framework\/","url_meta":{"origin":107,"position":4},"title":"\u5982\u4f55\u4f7f\u7528 java pdfbox \u6846\u67b6\u4ece HTML \u6216\u56fe\u50cf\u521b\u5efa PDF","author":"vkrastev2014","date":"11.04.2024","format":false,"excerpt":"Following example code here: In pom.xml insert or get the jar files and add them to the java project if you don't use maven <repositories> <repository> <id>jitpack.io<\/id> <url>https:\/\/jitpack.io<\/url> <\/repository> <\/repositories> <!-- https:\/\/mvnrepository.com\/artifact\/org.apache.pdfbox\/pdfbox --> <dependency> <groupId>org.apache.pdfbox<\/groupId> <artifactId>pdfbox<\/artifactId> <version>3.0.2<\/version> <\/dependency> <!-- https:\/\/mvnrepository.com\/artifact\/com.github.hkirk\/java-html2image --> <dependency> <groupId>com.github.hkirk<\/groupId> <artifactId>java-html2image<\/artifactId> <version>0.9<\/version> <\/dependency> and Java code here\u2026","rel":"","context":"In &quot;\u722a\u54c7&quot;","block_context":{"text":"\u722a\u54c7","link":"https:\/\/vkrastev1blog.com\/category\/%e7%88%aa%e5%93%87\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":55,"url":"https:\/\/vkrastev1blog.com\/2014\/05\/11\/important-shell-script-commands-which-are-oft-used\/","url_meta":{"origin":107,"position":5},"title":"\u5e38\u7528\u7684\u91cd\u8981 Shell \u811a\u672c\u547d\u4ee4","author":"vkrastev2014","date":"11.05.2014","format":false,"excerpt":"Here is a list of some important shell commands: ---- Using Screen command screen -ls -- for a list of avaliable active screens screen -x .... - the Name from -ls output to join to this active screen Go out of the Screen with 'ctrl a+d' without stopping it ----\u2026","rel":"","context":"In &quot;\u5176\u4ed6\u7684&quot;","block_context":{"text":"\u5176\u4ed6\u7684","link":"https:\/\/vkrastev1blog.com\/category\/%e5%85%b6%e4%bb%96%e7%9a%84\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/users\/65283547"}],"replies":[{"embeddable":true,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/comments?post=107"}],"version-history":[{"count":4,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/posts\/107\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/media?parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/categories?post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vkrastev1blog.com\/wp-json\/wp\/v2\/tags?post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}