{"id":3079,"date":"2019-07-06T18:59:31","date_gmt":"2019-07-06T09:59:31","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=3079"},"modified":"2026-04-20T18:22:16","modified_gmt":"2026-04-20T09:22:16","slug":"git-push","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/3079","title":{"rendered":"[git] push"},"content":{"rendered":"<p>git push \u30b3\u30de\u30f3\u30c9\u8a73\u7d30<\/p>\n<h3>\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u3068\u30ea\u30e2\u30fc\u30c8\uff08\u8ffd\u8de1\uff09\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u306e\u53cc\u65b9\u3092\u660e\u793a\u7684\u306b\u6307\u5b9a<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push <\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u540d> <\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d>:<\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d><\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin foo:bar<\/pre>\n<p>\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e foo \u30d6\u30e9\u30f3\u30c1\u3092\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea origin \u306e bar \u30d6\u30e9\u30f3\u30c1\u3078 push\u3059\u308b<\/p>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin master:master<\/pre>\n<p>\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e master \u30d6\u30e9\u30f3\u30c1\u3092\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea origin \u306e master \u30d6\u30e9\u30f3\u30c1\u3078 push\u3059\u308b<br \/>\n<!--more--><\/p>\n<h3>\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u3092\u7701\u7565<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push <\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u540d> <\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d><\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin master<\/pre>\n<p>\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\uff08push\u5148\uff09\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u304c\u7701\u7565\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u3068\u540c\u3058\u30d6\u30e9\u30f3\u30c1\u540d master \u306b\u5bfe\u3057\u3066 push\u3059\u308b\u3002(\u4f46\u3057\u3001push.default\u306e\u8a2d\u5b9a\u306b\u4f9d\u5b58\u3059\u308b)<\/p>\n<h3>upstream\u306e\u8a2d\u5b9a\u3064\u304d<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push -u origin master<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push --set-upstream origin master<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push -u origin foo:bar<\/pre>\n<h3>\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u3068\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u3092\u7701\u7565<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push<\/pre>\n<p>push\u306e\u9001\u308a\u5143\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u3082\u7701\u7565\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u300e\u3069\u308c\u300f\u3068\u300e\u3069\u308c\u300f\u306e\u30d6\u30e9\u30f3\u30c1\u304b\u3089\u3001\u300e\u3069\u308c\u300f\u3068\u300e\u3069\u308c\u300f\u306e\u30d6\u30e9\u30f3\u30c1\u3078 push \u3055\u308c\u308b\u304b\u306f\u3001\u30ed\u30fc\u30ab\u30eb\u306e\u74b0\u5883\u8a2d\u5b9a\u4f9d\u5b58\u3002\u53e4\u3044\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\uff08push.default\uff09\u306f\u3001\u540d\u524d\u304c\u4e00\u81f4\u3059\u308b(matching)\u30d6\u30e9\u30f3\u30c1\u3092\u300e\u5168\u3066\u300fpush\u3059\u308b\u3002\u300e\u5168\u3066\u300f\u3068\u3044\u3046\u3053\u3068\u306f\u8907\u6570\u306e\u30d6\u30e9\u30f3\u30c1\u3092\uff11\u56de\u306epush\u30b3\u30de\u30f3\u30c9\u3067push\u3059\u308b\uff08\u3067\u304d\u308b\uff09\u3053\u3068\u3092\u610f\u56f3\u3059\u308b\u3002\u3064\u307e\u308a\u3001git push &#8211;all \u3057\u304b\u3057\u540d\u524d\u304c\u4e00\u81f4\u3057\u306a\u3044\uff08\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u5b58\u5728\u3057\u306a\u3044\uff09\u30d6\u30e9\u30f3\u30c1\uff08\u540d\uff09\u306fpush\u3057\u306a\u3044\u3001\u3068\u3044\u3046\u6319\u52d5\u306b\u306a\u308b\u3002<\/p>\n<h3>\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u306e\u524a\u9664<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin :foo<\/pre>\n<p>\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u300e\u7a7a\u300f\u30d6\u30e9\u30f3\u30c1\u3092\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea origin \u306e foo\u30d6\u30e9\u30f3\u30c1\u3078push\u3059\u308b\u3002<br \/>\n\u3059\u306a\u308f\u3061\u3001\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e foo\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3059\u308b\u3002<\/p>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin --delete foo<\/pre>\n<p>\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1 foo \u306b\u5bfe\u3057\u3066 delete \u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u304d\u3067 push \u3059\u308b\u3053\u3068\u3067\u660e\u793a\u7684\u306b\u524a\u9664\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n<h3>Upstream(\u4e0a\u6d41\u30d6\u30e9\u30f3\u30c1\uff0f\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1)\u306e\u8a2d\u5b9a\u30aa\u30d7\u30b7\u30e7\u30f3<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push -u origin master<\/pre>\n<p>\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3068\u540c\u4e00<\/p>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin master\r\n\r\n$ git branch master -u origin\/master<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin <\u30ed\u30fc\u30ab\u30eb\u30d6\u30e9\u30f3\u30c1\u540d>\r\n\r\n$ git branch <\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u540d> -u <\u30ea\u30e2\u30fc\u30c8\u30d6\u30e9\u30f3\u30c1\u540d><\/pre>\n<h3>\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5168\u3066\u306e\u30d6\u30e9\u30f3\u30c1\u3092push\u3059\u308b\u3002<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push origin --all<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git config default.push match\r\n\r\n$ git push<\/pre>\n<p>&nbsp;<\/p>\n<h3>\u304a\u307e\u3051 : \u5b9f\u884c\u3057\u306a\u3044\u3067\u30c6\u30b9\u30c8\u3060\u3051<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git push --dry-run<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>git push \u30b3\u30de\u30f3\u30c9\u8a73\u7d30 \u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u3068\u30ea\u30e2\u30fc\u30c8\uff08\u8ffd\u8de1\uff09\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u306e\u53cc\u65b9\u3092\u660e\u793a\u7684\u306b\u6307\u5b9a $ git push : $ git push origin foo:bar \u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[2],"class_list":["post-3079","post","type-post","status-publish","format-standard","hentry","category-memo","tag-git"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/3079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=3079"}],"version-history":[{"count":12,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/3079\/revisions"}],"predecessor-version":[{"id":8622,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/3079\/revisions\/8622"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=3079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=3079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=3079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}