<?xml version="1.0" encoding="UTF-8"?>
<article>
  <body>&#38291;&#36949;&#12387;&#12390;remote&#12502;&#12521;&#12531;&#12481;&#12434;&#20316;&#12387;&#12390;&#12375;&#12414;&#12387;&#12383;&#12398;&#12391;&#12377;&#12364;&#12289;&#21193;&#24375;&#12395;&#12394;&#12387;&#12383;&#12398;&#12391;&#35352;&#20107;&#12395;&#12375;&#12390;&#12362;&#12365;&#12414;&#12377; &#65307;P

###remote&#12395;local_deploy&#12502;&#12521;&#12531;&#12481;&#12434;&#20316;&#25104;

shell&gt;&gt;
$ git push origin local_deploy  #&#38291;&#36949;&#12387;&#12390;&#20316;&#25104;
$ git branch -a
* master
  origin/HEAD
  origin/deploy
  origin/local_deploy #&#12525;&#12540;&#12459;&#12523;&#12395;&#12418;&#21453;&#26144;&#12373;&#12428;&#12390;&#12356;&#12427;
  origin/master
&lt;&lt;--
  
  
###remote&#12502;&#12521;&#12531;&#12481;&#12434;&#21066;&#38500;
shell&gt;&gt;
$ git push origin :local_deploy
&lt;&lt;--
&#12371;&#12428;&#12391;&#12469;&#12540;&#12496;&#20596;&#12399;&#21453;&#26144;&#12373;&#12428;&#12414;&#12375;&#12383;&#12290;

  
###&#21029;&#12398;&#12525;&#12540;&#12459;&#12523;&#12522;&#12509;&#12472;&#12488;&#12522;(cloned)&#12391;&#21066;&#38500;&#12364;&#21453;&#26144;&#12373;&#12428;&#12394;&#12356;
&#12375;&#12363;&#12375;&#12418;&#12358;&#19968;&#12388;&#21029;&#12398;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12391;&#21516;&#12376;git&#12522;&#12509;&#12472;&#12488;&#12522;&#12434;clone&#12375;&#12390;&#12356;&#12390;&#12289;&#12381;&#12385;&#12425;&#12391;&#21066;&#38500;&#12364;&#21453;&#26144;&#12373;&#12428;&#12394;&#12356;&#29366;&#27841;&#12395;&#12290;

&#19979;&#35352;&#12398;1.&#12398;&#35500;&#26126;&#12395;&#12354;&#12427;&#12424;&#12358;&#12395;&#12289;**(remote&#12502;&#12521;&#12531;&#12481;&#12398;&#36861;&#21152;&#12399;&#33258;&#21205;&#12391;&#12373;&#12428;&#12427;&#12364;)&#21066;&#38500;&#12373;&#12428;&#12383;&#12418;&#12398;&#12399;&#12525;&#12540;&#12459;&#12523;&#12391;&#26126;&#31034;&#30340;&#12395;&#21066;&#38500;&#12375;&#12394;&#12356;&#12392;&#12356;&#12369;&#12394;&#12356;**&#12424;&#12358;&#12391;&#12377;&#12290;  

&gt; Delete unneeded branch  
&gt;    $ git clone git://git.kernel.org/.../git.git my.git  
&gt;    $ cd my.git  
&gt;    $ git branch -d -r origin/todo origin/html origin/man   (1)  
&gt;    $ git branch -D test                                    (2)  
&gt;
&gt;       1. Delete remote-tracking branches &quot;todo&quot;, &quot;html&quot;, &quot;man&quot;. Next fetch or pull will create them again unless you configure them not to. See git-fetch(1).  
&gt;       2. Delete &quot;test&quot; branch even if the &quot;master&quot; branch (or whichever branch is currently checked out) does not have all commits from test branch. 
&gt; &lt;http://www.kernel.org/pub/software/scm/git/docs/git-branch.html&gt;

(&#19978;&#12395;&#12424;&#12427;&#12392;&#12289;**git branch -d -r origin/removed_branch**&#12391;&#12418;remote&#12502;&#12521;&#12531;&#12481;&#12364;&#21066;&#38500;&#12391;&#12365;&#12427;&#12424;&#12358;&#12391;&#12377;&#12397;)

  
###&#12467;&#12510;&#12531;&#12489;git remote show origin, git remote prune origin
git remote&#36794;&#12426;&#12395;&#12467;&#12510;&#12531;&#12489;&#12364;&#12354;&#12427;&#12392;&#30693;&#12387;&#12383;&#12398;&#12391;&#35211;&#12390;&#12415;&#12427;&#12392;&#12289;**git remote show**&#12364;&#12354;&#12426;&#12414;&#12375;&#12383;&#12290;
&#30906;&#35469;&#12377;&#12427;&#12392;&#12289;&#33104;&#12426;&#12363;&#12369;&#12383;(Stale)tracking branch&#12392;&#34920;&#31034;&#12373;&#12428;&#12390;&#12356;&#12414;&#12377;&#12290;

shell&gt;&gt;
$ git remote show origin
* remote origin
  URL: ssh://git.s21g.com/mnt/git/blog.git
  Remote branch merged with 'git pull' while on branch master
    master
  Stale tracking branch (use 'git remote prune')
    local_deploy
  Tracked remote branches
    deploy master
&lt;&lt;--

&#12381;&#12375;&#12390;&#12289;**prune**&#12391;&#21066;&#38500;&#12290;&#12504;&#12523;&#12503;&#12395;&#12399;&#12289;**--dry-run**&#12391;&#12420;&#12427;&#12392;&#12393;&#12398;&#12502;&#12521;&#12531;&#12481;&#12434;prune&#12377;&#12427;&#12363;&#12524;&#12509;&#12540;&#12488;&#12375;&#12390;&#12367;&#12428;&#12390;&#12289;&#23455;&#38555;&#12398;action&#12399;&#12375;&#12394;&#12356;&#26088;&#12364;&#35352;&#36848;&#12373;&#12428;&#12390;&#12356;&#12427;&#12398;&#12391;&#12377;&#12364;&#12289;&#31169;&#12398;&#29872;&#22659;&#12391;&#12399;&#21066;&#38500;&#12373;&#12428;&#12390;&#12375;&#12414;&#12356;&#12414;&#12375;&#12383;&#12290;

shell&gt;&gt;
$ git remote prune origin --dry-run
&lt;&lt;--

###Refs
&lt;http://www.kernel.org/pub/software/scm/git/docs/git-remote.html&gt;  
&lt;http://www.kernel.org/pub/software/scm/git/docs/git-branch.html&gt;  
&lt;http://reinh.com/blog/2008/04/18/git-push-just-the-tip.html&gt;
</body>
  <cached-tag-list>git</cached-tag-list>
  <comments-count type="integer">0</comments-count>
  <created-at type="datetime">2008-10-31T12:51:52+00:00</created-at>
  <daily-archive-id type="integer">851</daily-archive-id>
  <filter-type>blue_stole</filter-type>
  <id type="integer">992</id>
  <monthly-archive-id type="integer">102</monthly-archive-id>
  <pdf-digest nil="true"></pdf-digest>
  <permalink nil="true"></permalink>
  <published-at type="datetime">2008-10-31T12:54:00+00:00</published-at>
  <secret>a8504a18-bdbf-4fd7-8d4c-df035ecacc0a</secret>
  <title>[git] &#21066;&#38500;&#12373;&#12428;&#12383;remote&#12502;&#12521;&#12531;&#12481;&#12364;&#12525;&#12540;&#12459;&#12523;Repo&#12391;&#28040;&#12360;&#12394;&#12367;&#12394;&#12387;&#12383;&#12392;&#12365; </title>
  <updated-at type="datetime">2008-10-31T12:57:22+00:00</updated-at>
  <user-id type="integer">3</user-id>
</article>
