{"id":1,"date":"2021-02-12T01:36:33","date_gmt":"2021-02-12T01:36:33","guid":{"rendered":"http:\/\/test.speed.jetboy.jp\/?p=1"},"modified":"2025-04-13T15:08:48","modified_gmt":"2025-04-13T06:08:48","slug":"git-command","status":"publish","type":"post","link":"https:\/\/memo-log.net\/?p=1","title":{"rendered":"git\u3067\u3088\u304f\u4f7f\u3046\u30b3\u30de\u30f3\u30c9\u307e\u3068\u3081"},"content":{"rendered":"<dl>\n<dt><code>git add -u<\/code><\/dt>\n<dd>\n<ul>\n<li>\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3055\u308c\u3066\u3044\u3066\u3001\u5909\u66f4\u304c\u3042\u3063\u305f\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u304c<code>add<\/code>\u3055\u308c\u308b<br \/>\uff08\u5909\u66f4\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3001\u524a\u9664\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\uff09<\/li>\n<li>\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3055\u308c\u3066\u3044\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u306f<code>add<\/code>\u3055\u308c\u306a\u3044<br \/>\uff08\u65b0\u3057\u304f\u4f5c\u3089\u308c\u305f\u30d5\u30a1\u30a4\u30eb\uff09<\/li>\n<\/ul>\n<\/dd>\n<dt><code>git add \u30d5\u30a1\u30a4\u30eb\u540dor\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d<\/code><\/dt>\n<dd>\n<ul>\n<li>\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3059\u308b\uff08\u5909\u66f4\u5c65\u6b74\u3092\u6b8b\u3057\u305f\u3044\uff09\u30d5\u30a1\u30a4\u30eb\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u767b\u9332\u3059\u308b\u3002<\/li>\n<li>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u4e2d\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u304c\u3059\u3079\u3066\u30b9\u30c6\u30fc\u30b8\u306b\u767b\u9332\u3055\u308c\u308b\u3002<\/li>\n<li>\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u307e\u3068\u3081\u3066\u767b\u9332\u3059\u308b\u5834\u5408\u306f\u3001\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u306e\u5f8c\u306b\u30d5\u30a1\u30a4\u30eb\u540d\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3092\u8a18\u8ff0\u3002<\/li>\n<\/ul>\n<\/dd>\n<dt><code>git commit -m \"\u5909\u66f4\u5185\u5bb9\u3092\u66f8\u304f\"<\/code><\/dt>\n<dd>\u30b9\u30c6\u30fc\u30b8\u306b\u767b\u9332\uff08add\uff09\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u5185\u5bb9\u304c\u4fdd\u5b58\u3055\u308c\u308b\u3002<\/dd>\n<\/dl>\n<dl>\n<dt><code>git commit --amend --no-edit<\/code><\/dt>\n<dd>\u30b9\u30c6\u30fc\u30b8\u306b\u767b\u9332\uff08add\uff09\u3055\u308c\u3066\u3044\u308b\u5185\u5bb9\u3092\u76f4\u524d\u306e\u30b3\u30df\u30c3\u30c8\u306b\u307e\u3068\u3081\u3066\u4fdd\u5b58\u3059\u308b\u3002commit\u3057\u305f\u5f8c\u306b\u8ffd\u52a0\u4fee\u6b63\u7b49\u3057\u3066\u305d\u306e\u5185\u5bb9\u3082\u76f4\u524d\u306e\u30b3\u30df\u30c3\u30c8\u306b\u542b\u3081\u305f\u3044\u5834\u5408\u306b\u4fbf\u5229\u3002<\/dd>\n<\/dl>\n<dl>\n<dt><code>git log<\/code><\/dt>\n<dd>git\u306e\u904e\u53bb\u30ed\u30b0\u3092\u78ba\u8a8d\u3059\u308b\u3002\u30ed\u30b0\u4e00\u89a7\u304b\u3089\u629c\u3051\u308b\u306b\u306f\u300cQ\u300d\u30ad\u30fc\u3092\u62bc\u3059\u3002<\/dd>\n<dd>\u5909\u66f4\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u540d\u3082\u898b\u305f\u3044\u5834\u5408\u306f\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u300cgit log &#8211;name-status\u300d\u3092\u8a2d\u5b9a\u3059\u308b\u3002<\/dd>\n<dt><code>git status<\/code><\/dt>\n<dd>git\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u5bfe\u8c61\u30d5\u30a1\u30a4\u30eb\u306egit\u4e0a\u3067\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\u3002\n<ul>\n<li>commit\u3055\u308c\u305f\u72b6\u614b<\/li>\n<li>git add\u3055\u308c\u305f\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u72b6\u614b<\/li>\n<li>git add\u3055\u308c\u308b\u524d\u306e\u30a2\u30f3\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u72b6\u614b<\/li>\n<\/ul>\n<\/dd>\n<\/dl>\n\n\n<h3>\u904e\u53bb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u4e00\u6642\u7684\u306b\u5dfb\u304d\u623b\u3057\u3001\u305d\u306e\u5f8c\u3001\u307e\u305f\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u623b\u3059<\/h3>\n\n\n\n<p>\u3044\u304f\u3064\u304b\u65b9\u6cd5\u304c\u3042\u308b\u304c\u3001\u3053\u308c\u304c\u4e00\u756a\u30ab\u30f3\u30bf\u30f3\u305d\u3046\u3002<\/p>\n\n\n\n<p><dl>\n<dt>\u5dfb\u304d\u623b\u3057<\/dt>\n<dd><code>git checkout \u623b\u308a\u305f\u3044\u30b3\u30df\u30c3\u30c8\u540d(\u4e88\u3081git log\u30b3\u30de\u30f3\u30c9\u3067\u8abf\u3079\u3066\u30b3\u30d4\u30fc\u3057\u3066\u304a\u304f)<\/code><\/dd>\n<dt>\u307e\u305f\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u623b\u308b<\/dt>\n<dd><code>git checkout master<\/code><\/dd>\n<\/dl><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git init<\/code><\/pre><\/div>\n\n\n\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u65b0\u898f\u306b\u4f5c\u6210\u3059\u308b\u3002<br>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3059\u308b\u969b\u3001\u6700\u521d\u306b\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git ls-files<\/code><\/pre><\/div>\n\n\n\n<p>git\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u89a7\u8868\u793a\u3059\u308b\u3002<br>\u3064\u3065\u308a\u306f\u3001\u30a8\u30eb \u30a8\u30b9\uff08ls\uff09\u3067\u59cb\u307e\u308b\u3002\u30a2\u30a4 \u30a8\u30b9\u3067\u306f\u306a\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git reset --hard<\/code><\/pre><\/div>\n\n\n\n<p>\u300c\u307e\u3060add\u3057\u3066\u3044\u306a\u3044\u4fee\u6b63\u30fb\u5909\u66f4\u3092\u3059\u3079\u3066\u53d6\u308a\u6d88\u3057\u3066\u76f4\u524d\u306e\u30b3\u30df\u30c3\u30c8\u306b\u623b\u308a\u305f\u3044\u300d\u3068\u3044\u3046\u5834\u5408\u306b\u4f7f\u3063\u305f\u3002<br>git\u7684\u306b\u3044\u3046\u3068\u300c\u4f5c\u696d\u30c4\u30ea\u30fc\u306e\u5185\u5bb9\u3092HEAD\u306e\u72b6\u614b\u306b\u623b\u3059\u300d\u3068\u306a\u308b\u3002<br>\u3082\u3061\u308d\u3093git reset &#8211;hard\u306f\u3001\u30b9\u30c6\u30fc\u30b8\u3057\u305f\u5185\u5bb9\u3082\u3059\u3079\u3066\u6368\u3066\u3066\u76f4\u524d\u306e\u30b3\u30df\u30c3\u30c8\u306b\u623b\u308b\u3002<\/p>\n\n\n\n<p>.gitignore\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u5834\u6240\u306f.git\u30d5\u30a9\u30eb\u30c0\u306e\u4e2d\u3067\u306f\u306a\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-git\" data-lang=\"Git\"><code>git reset HEAD file_name<\/code><\/pre><\/div>\n\n\n\n<p>\u7279\u5b9a\u306e\u30d5\u30a1\u30a4\u30eb\u306egit add\u3092\u53d6\u308a\u6d88\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>git add -u \u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3055\u308c\u3066\u3044\u3066\u3001\u5909\u66f4\u304c\u3042\u3063\u305f\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u304cadd\u3055\u308c\u308b\uff08\u5909\u66f4\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3001\u524a\u9664\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\uff09 \u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3055\u308c\u3066\u3044\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u306fadd\u3055\u308c\u306a\u3044\uff08\u65b0\u3057\u304f\u4f5c\u3089\u308c\u305f\u30d5\u30a1\u30a4\u30eb\uff09 git  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/memo-log.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1"}],"version-history":[{"count":0,"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions"}],"wp:attachment":[{"href":"https:\/\/memo-log.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/memo-log.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/memo-log.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}