{"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":"C\u00e1c l\u1ec7nh v\u00e0 h\u01b0\u1edbng d\u1eabn quan tr\u1ecdng c\u1ee7a Git"},"content":{"rendered":"<p>C\u00e1ch nh\u1eadn tr\u1ee3 gi\u00fap v\u1ec1 l\u1ec7nh Git<\/p>\n<p><em>gi\u00fap \u0111\u1ee1<\/em> [-a|&#8211;all|-i|&#8211;info|-m|&#8211;man|-w|&#8211;web] [COMMAND]<\/p>\n<p>V\u00ed d\u1ee5: git tr\u1ee3 gi\u00fap git<\/p>\n<p>N\u00f3 kh\u1edfi ch\u1ea1y m\u1ed9t tr\u00ecnh duy\u1ec7t v\u00e0 hi\u1ec3n th\u1ecb tr\u1ee3 gi\u00fap v\u1ec1 HTML.<\/p>\n<p>Thi\u1ebft l\u1eadp kho l\u01b0u tr\u1eef c\u1ee5c b\u1ed9 v\u00e0 th\u1ef1c hi\u1ec7n l\u1ea7n \u0111\u1ea9y \u0111\u1ea7u ti\u00ean:<\/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>Kho l\u01b0u tr\u1eef thanh to\u00e1n<\/p>\n<pre><code>git clone git:\/\/github.com\/schacon\/grit.git<\/code><\/pre>\n<p>\u0110\u1ec3 cam k\u1ebft c\u00e1c thay \u0111\u1ed5i \u0111\u1ed1i v\u1edbi kho l\u01b0u tr\u1eef c\u1ee5c b\u1ed9, ch\u1ec9 c\u1ea7n th\u00eam, h\u01a1n l\u00e0 cam k\u1ebft. N\u1ebfu b\u1ea1n mu\u1ed1n \u0111\u1ea9y nh\u00e1nh c\u1ee5c b\u1ed9\/c\u00e1c thay \u0111\u1ed5i sang kho l\u01b0u tr\u1eef t\u1eeb xa, ch\u1ec9 c\u1ea7n th\u1ef1c hi\u1ec7n l\u1ec7nh \u0111\u1ea9y b\u00ean d\u01b0\u1edbi.<\/p>\n<pre>git add --all\r\n\r\ngit commit --all\r\n\r\ngit push\r\n<\/pre>\n<p>L\u1ec7nh \u0111\u1ea9y v\u00e0o kho l\u01b0u tr\u1eef<\/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>C\u00e1c l\u1ec7nh kh\u00e1c \u0111\u1ec3 t\u00ecm trong c\u00e1c li\u00ean k\u1ebft sau.<\/p>\n<p>Git h\u00e0ng ng\u00e0y v\u1edbi 20 l\u1ec7nh<\/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>H\u01b0\u1edbng d\u1eabn Git hay<\/p>\n<p>H\u01b0\u1edbng d\u1eabn l\u00e0m 1 b\u00e0i \u0111\u1ea7u ti\u00ean &#8211; <a href=\"http:\/\/git-scm.com\/docs\/gittutorial\" rel=\"nofollow\">http:\/\/git-scm.com\/docs\/gittutorial<\/a><\/p>\n<p>H\u01b0\u1edbng d\u1eabn th\u1ef1c hi\u1ec7n 2 gi\u00e2y &#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>H\u01b0\u1edbng d\u1eabn th\u00eam &#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>C\u00e1ch nh\u1eadn tr\u1ee3 gi\u00fap Git [-a|&#8211;all|-i|&#8211;info|-m|&#8211;man|-w|&#8211;web] [COMMAND] V\u00ed d\u1ee5: git help help git N\u00f3 t\u1ecb \u0111\u1ecbnh \u0111\u1ecbnh ph\u1ea7n b\u1ea1n v\u1ec1 \u0111\u1ecbnh th\u1ecb tr\u1ee3 gi\u00fap \u0111\u1ebfn HTML. Ch\u1eadm l\u1ea1i kho \u1ea3nh b\u1ed1i b\u1ed9 v\u00e0 \u0111\u1ebfn \u0111\u1ebfn \u0111\u01b0\u1ee3c t\u01b0\u1eddi: cd my_project git init git add * git commit -m &#8220;My [&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-java","tag-lenh","tag-git","tag-lenh-git","tag-huong-dan-git","tag-cach-su-dung-git","tag-su-dung-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":"S\u1ef1 c\u1ed1 Eclipse b\u1eb1ng c\u00e1ch thay \u0111\u1ed5i m\u1eadt kh\u1ea9u GIT","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;Java&quot;","block_context":{"text":"Java","link":"https:\/\/vkrastev1blog.com\/category\/java\/"},"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":"C\u00e1ch c\u00e0i \u0111\u1eb7t testdisk tr\u00ean Ubuntu v\u00e0 th\u00eam kho v\u0169 tr\u1ee5","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;Ng\u01b0\u1eddi kh\u00e1c&quot;","block_context":{"text":"Ng\u01b0\u1eddi kh\u00e1c","link":"https:\/\/vkrastev1blog.com\/category\/nguoi-khac\/"},"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":"C\u00e1ch c\u00e0i \u0111\u1eb7t tr\u00ecnh \u0111i\u1ec1u khi\u1ec3n NVIDIA m\u1edbi nh\u1ea5t tr\u00ean Ubuntu","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;Ng\u01b0\u1eddi kh\u00e1c&quot;","block_context":{"text":"Ng\u01b0\u1eddi kh\u00e1c","link":"https:\/\/vkrastev1blog.com\/category\/nguoi-khac\/"},"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":"C\u00e1ch s\u1eeda Bootloader sau khi c\u00e0i \u0111\u1eb7t Ubuntu tr\u00ean PC Windows \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t s\u1eb5n l\u00e0m h\u1ec7 \u0111i\u1ec1u h\u00e0nh th\u1ee9 hai","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;Ng\u01b0\u1eddi kh\u00e1c&quot;","block_context":{"text":"Ng\u01b0\u1eddi kh\u00e1c","link":"https:\/\/vkrastev1blog.com\/category\/nguoi-khac\/"},"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":"C\u00e1ch t\u1ea1o PDF t\u1eeb HTML ho\u1eb7c h\u00ecnh \u1ea3nh b\u1eb1ng khung java pdfbox","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;Java&quot;","block_context":{"text":"Java","link":"https:\/\/vkrastev1blog.com\/category\/java\/"},"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":"C\u00e1c l\u1ec7nh Shell script quan tr\u1ecdng th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng","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;Ng\u01b0\u1eddi kh\u00e1c&quot;","block_context":{"text":"Ng\u01b0\u1eddi kh\u00e1c","link":"https:\/\/vkrastev1blog.com\/category\/nguoi-khac\/"},"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}]}}