{"id":7173,"date":"2019-11-19T21:25:36","date_gmt":"2019-11-19T12:25:36","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=7173"},"modified":"2023-05-27T19:00:22","modified_gmt":"2023-05-27T10:00:22","slug":"%e3%80%90git%e3%80%91%e3%83%96%e3%83%a9%e3%83%b3%e3%83%81%e3%81%ab%e9%96%a2%e3%81%99%e3%82%8b%e7%9f%a5%e8%ad%98","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=7173","title":{"rendered":"\u3010Git\u3011\u30d6\u30e9\u30f3\u30c1\u306b\u95a2\u3059\u308b\u77e5\u8b58"},"content":{"rendered":"<h2>\u30d6\u30e9\u30f3\u30c1\u3068\u306f\uff1f<\/h2>\n<p>Git\u3067\u8a18\u9332\u3059\u308b\u5c65\u6b74\u3092\u672c\u6d41\u304b\u3089\u5206\u5c90\uff08\u679d\u5206\u304b\u308c\u3055\u305b\u308b\uff09\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3>Git\u306e\u4ed5\u7d44\u307f\u7684\u306a\u89b3\u70b9\u304b\u3089\u898b\u305f\u30d6\u30e9\u30f3\u30c1<\/h3>\n<p>\u30d6\u30e9\u30f3\u30c1\u306e\u60c5\u5831\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u30ea\u30dd\u30b8\u30c8\u30ea(.git\u30c7\u30a3\u30ec\u30af\u30c8\u30ea)\u306e\u4e2d(.git\/refs\/)\u306b\u8a18\u9332<\/strong><\/span>\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u300c\u30b3\u30df\u30c3\u30c8\u3092\u6307\u3057\u793a\u3057\u305f\u30dd\u30a4\u30f3\u30bf\u300d<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u5177\u4f53\u7684\u306b\u306f\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u969b\u306b\u63a1\u756a\u3055\u308c\u308b\u30b3\u30df\u30c3\u30c8ID(40\u6841\u306e\u30cf\u30c3\u30b7\u30e5)\u3092\u8a18\u9332\u3057\u3066\u3044\u308b\u3060\u3051\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u4ed5\u7d44\u307f\u3067\u3059\u3002\uff09\u4f5c\u696d\u4e2d\u306e\u30d6\u30e9\u30f3\u30c1\u306b\u3066\u30d6\u30e9\u30f3\u30c1\u5185\u3067\u30b3\u30df\u30c3\u30c8\u3059\u308b\u3068\u305d\u306e\u30d6\u30e9\u30f3\u30c1\u5185\u306e\u6700\u65b0\u306e\u30b3\u30df\u30c3\u30c8\u3092\u6307\u3057\u793a\u3059\u3088\u3046\u306b\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u306b\u3064\u3044\u3066<\/h2>\n<p>git fetch\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u969b\u306b<span style=\"color: #ff0000;\"><strong>\u300corigin\/master\u300d<\/strong><\/span>\u7b49\u306e\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u306f<span style=\"color: #ff0000;\"><strong>\u30ea\u30e2\u30fc\u30c8\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u5185\u5bb9\u3092\u30ed\u30fc\u30ab\u30eb\u306b\u4fdd\u5b58\u3057\u3066\u3001\u305d\u306e\u30d6\u30e9\u30f3\u30c1\u3078\u306e\u72b6\u614b\u3078\u306e\u30dd\u30a4\u30f3\u30bf\u306e\u3053\u3068\u3092\u6307\u3057\u3066\u304a\u308a\u300c\u30ea\u30e2\u30fc\u30c8\u3067\u306e\u5909\u66f4\u5185\u5bb9\u300d(\u8ab0\u304b\u304c\u7de8\u96c6\u3057\u3066\u3044\u308b\u7b49)\u3092\u6271\u3046\u30d6\u30e9\u30f3\u30c1\u3067\u3059\u3002<\/strong><\/span>\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u306e\u5185\u5bb9\u306f\u30ed\u30fc\u30ab\u30eb\u306b\u30de\u30fc\u30b8\u3057\u3066\u53d6\u308a\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p>git fetch\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u306b\u65b0\u3057\u304f\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u5dee\u5206\u306e\u30b3\u30df\u30c3\u30c8\u60c5\u5831\u304c\u300corigin\/\u300d\u3068\u3044\u3046\u63a5\u982d\u8f9e\u304c\u3064\u3044\u3066\u30ed\u30fc\u30ab\u30eb\u306b\u4fdd\u5b58\u3055\u308c\u308b\u306e\u3067\u3059\u3002<\/p>\n<h2>\u30d6\u30e9\u30f3\u30c1\u306e\u7a2e\u985e<\/h2>\n<h3>master\u30d6\u30e9\u30f3\u30c1<\/h3>\n<p>Git\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u3068\u81ea\u52d5\u3067\u6700\u521d\u304b\u3089\u4f5c\u3089\u308c\u308b\u30d6\u30e9\u30f3\u30c1\u3067<span style=\"color: #ff0000;\"><strong>\u300c\u672c\u6d41\u300d<\/strong><\/span>\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306b\u3001<span style=\"color: #ff0000;\"><strong>\u672c\u756a\u7528\u306e\u6700\u65b0\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u5834\u6240<\/strong><\/span>\u3068\u3044\u3046\u8a8d\u8b58\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\u30ea\u30ea\u30fc\u30b9\u5c02\u7528\u306e\u30d6\u30e9\u30f3\u30c1\u3067\u3042\u308a\u5b9f\u969b\u306b\u958b\u767a\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h3>\u30c8\u30d4\u30c3\u30af\u30d6\u30e9\u30f3\u30c1<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u77ed\u671f\u7684\u306b\u4f7f\u3046\u958b\u767a\u4f5c\u696d\u7528\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u3053\u3068<\/strong><\/span>\u3067\u3059\u3002\u57fa\u672c\u7684\u306b\u306fmaster\u30d6\u30e9\u30f3\u30c1\u306b\u3059\u3050\u306b\u5408\u6d41\u3055\u305b\u307e\u3059\u3002<\/p>\n<h2>\u30d6\u30e9\u30f3\u30c1\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\n<ul>\n<li>\u5225\u3005\u306e\u6a5f\u80fd\u3092\u5225\u3005\u306e\u958b\u767a\u8005\u304c\u5b9f\u88c5\u3057\u3066\u3044\u3066\u3082\u5f71\u97ff\u3092\u53ca\u307c\u3059\u3053\u3068\u306a\u304f\u958b\u767a\u3067\u304d\u308b\u70b9<\/li>\n<\/ul>\n<h2>\u30d6\u30e9\u30f3\u30c1\u306e\u7528\u9014<\/h2>\n<ul>\n<li>\u30d9\u30fc\u30b9\u54c1\u306f\u540c\u3058\u3060\u304c\u3001\u5225\u3005\u306e\u6a5f\u80fd\u3092\u5b9f\u88c5\u3055\u305b\u305f\u3044\u5834\u5408<\/li>\n<\/ul>\n<h2>\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9<\/h2>\n<pre class=\"lang:default decode:true\">git branch \u4f5c\u6210\u3059\u308b\u30d6\u30e9\u30f3\u30c1\u540d<\/pre>\n<p>\u306a\u304a\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f<span style=\"color: #ff0000;\"><strong>\u57fa\u672c\u7684\u306b\u5fc5\u305amaster\u30d6\u30e9\u30f3\u30c1\u3067\u884c\u3046\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/strong><\/span><\/p>\n<p>\u5225\u306e\u30d6\u30e9\u30f3\u30c1\u3067\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u65bd\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u5225\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u30d9\u30fc\u30b9\u3068\u3057\u305f\u3055\u3089\u306a\u308b\u5225\u30d6\u30e9\u30f3\u30c1\u304c\u4f5c\u3089\u308c\u3066\u3057\u307e\u3044\u968e\u5c64\u304c\u6df1\u304f\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3067\u3059\u3002<\/p>\n<h3>\u8907\u6570\u30d6\u30e9\u30f3\u30c1\u304c\u3042\u308b\u5834\u5408\u306b\u3069\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u4f7f\u3046\u304b<\/h3>\n<p>\u8907\u6570\u30d6\u30e9\u30f3\u30c1\u304c\u3042\u308b\u74b0\u5883\u3067\u306f\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u4f7f\u3046\u30d6\u30e9\u30f3\u30c1\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u305d\u308c\u4ee5\u964d\u306e\u64cd\u4f5c\u306f\u5168\u3066\u5207\u308a\u66ff\u3048\u5148\u306e\u30d6\u30e9\u30f3\u30c1\u306b\u3066\u884c\u308f\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002Git\u306e\u5185\u90e8\u52d5\u4f5c\u7684\u306b\u306fHEAD(\u4f5c\u696d\u4e2d\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u6700\u65b0\u30b3\u30df\u30c3\u30c8)\u304c\u79fb\u52d5\u3059\u308b\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><\/span><\/p>\n<pre class=\"lang:default decode:true\">git checkout \u5207\u308a\u66ff\u3048\u5148\u306e\u30d6\u30e9\u30f3\u30c1\u540d<\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u30d6\u30e9\u30f3\u30c1\u3092\u5207\u308a\u66ff\u3048\u308b\u5834\u5408\u306b\u3082\u4f7f\u3044\u307e\u3059\u304c\u3001\u672c\u6765\u6700\u3082\u4e00\u822c\u7684\u306a\u7528\u9014\u3068\u3057\u3066\u306f<span style=\"color: #ff0000;\"><strong>\u7279\u5b9a\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30ef\u30fc\u30af\u30c4\u30ea\u30fc\u306b\u53cd\u6620\u3055\u305b\u308b\u3053\u3068<\/strong><\/span>\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3059\u308b\u306e\u3068\u540c\u6642\u306b\u305d\u306e\u30d6\u30e9\u30f3\u30c1\u306b\u5207\u308a\u66ff\u3048\u308b\u30b3\u30de\u30f3\u30c9<\/h3>\n<pre class=\"lang:default decode:true \">git checkout -b \u4f5c\u6210\u3057\u5207\u308a\u66ff\u3048\u305f\u3044\u30d6\u30e9\u30f3\u30c1\u540d<\/pre>\n<h4>\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u6642\u306e\u6ce8\u610f\u70b9<\/h4>\n<p>\u305f\u3060\u3001<span style=\"color: #ff0000;\"><strong>\u30ef\u30fc\u30af\u30c4\u30ea\u30fc\u3067modified\u3068\u306a\u3063\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u5834\u5408\u306f\u7de8\u96c6\u3057\u305f\u5185\u5bb9\u304c\u4e0a\u66f8\u304d\u3055\u308c\u308b\u6050\u308c\u304c\u3042\u308b\u305f\u3081\u306b\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u969b\u306e\u30a8\u30e9\u30fc\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><\/span><\/p>\n<pre>error.Your local changes to the following files would be overwritten by chekout(\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b\u3068\u6b21\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3059\u308b\u5909\u66f4\u304c\u4e0a\u66f8\u304d\u3055\u308c\u3066\u3057\u307e\u3046\uff09<\/pre>\n<p>\u3053\u306e\u5834\u5408\u306e\u5bfe\u51e6\u3068\u3057\u3066\u306f\u3001modified\u3068\u306a\u3063\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30df\u30c3\u30c8\u3059\u308b\u304b\u3001\u7de8\u96c6\u3092\u53d6\u308a\u6d88\u3057\u305f\u308a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30d6\u30e9\u30f3\u30c1\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/h2>\n<pre class=\"lang:default decode:true \">git branch<\/pre>\n<h3>\u5168\u3066\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u8868\u793a\u3059\u308b\u3002<\/h3>\n<p>\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u3082\u542b\u3081\u3066\u5168\u3066\u306e\u30d6\u30e9\u30f3\u30c1\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">git branch -a<\/pre>\n<h2>\u30d6\u30e9\u30f3\u30c1\u540d\u3092\u5909\u66f4\u3059\u308b\u3002<\/h2>\n<p>\u81ea\u5206\u304c\u4eca\u4f5c\u696d\u3057\u3066\u3044\u308b\u30d6\u30e9\u30f3\u30c1\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u304c\u5909\u308f\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">git branch -m &lt;\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n<h2>\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3059\u308b\u3002<\/h2>\n<p>\u306a\u304a\u3001<span style=\"color: #ff0000;\"><strong>master\u306b\u307e\u3060\u30de\u30fc\u30b8\u3055\u308c\u3066\u3044\u306a\u3044\u30d6\u30e9\u30f3\u30c1\u306e\u5834\u5408\u306f\u524a\u9664\u306f\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002<\/strong><\/span>\u306a\u306e\u3067\u5b89\u5168\u306a\u30b3\u30de\u30f3\u30c9\u3068\u8a00\u3048\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:default decode:true \">git branch -d &lt;\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n<h3>\u30d6\u30e9\u30f3\u30c1\u3092\u5f37\u5236\u524a\u9664\u3059\u308b\u3002<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>master\u306b\u307e\u3060\u30de\u30fc\u30b8\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u3068\u3057\u3066\u3082\u5f37\u5236\u7684\u306b\u524a\u9664\u3092\u3059\u308b<\/strong><\/span>\u30b3\u30de\u30f3\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true  \">git branch -D &lt;\u30d6\u30e9\u30f3\u30c1\u540d&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"\u30d6\u30e9\u30f3\u30c1\u3068\u306f\uff1f Git\u3067\u8a18\u9332\u3059\u308b\u5c65\u6b74\u3092\u672c\u6d41\u304b\u3089\u5206\u5c90\uff08\u679d\u5206\u304b\u308c\u3055\u305b\u308b\uff09\u3053\u3068\u3067\u3059\u3002 Git\u306e\u4ed5\u7d44\u307f\u7684\u306a\u89b3\u70b9\u304b\u3089\u898b\u305f\u30d6\u30e9\u30f3\u30c1 \u30d6\u30e9\u30f3\u30c1\u306e\u60c5\u5831\u306f\u3001\u30ea\u30dd\u30b8\u30c8\u30ea(.git\u30c7\u30a3\u30ec\u30af\u30c8\u30ea)\u306e\u4e2d(.git\/refs\/)\u306b\u8a18\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u3002 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[32],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/7173"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7173"}],"version-history":[{"count":37,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/7173\/revisions"}],"predecessor-version":[{"id":20195,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/7173\/revisions\/20195"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7173"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}