• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

間違ってremoteブランチを作ってしまったのですが、勉強になったので記事にしておきます ;P

###remoteにlocal_deployブランチを作成

shell>>
$ git push origin local_deploy #間違って作成
$ git branch -a

  • master
    origin/HEAD
    origin/deploy
    origin/local_deploy #ローカルにも反映されている
    origin/master
    <<--

###remoteブランチを削除
shell>>
$ git push origin :local_deploy
<<--
これでサーバ側は反映されました。

###別のローカルリポジトリ(cloned)で削除が反映されない
しかしもう一つ別のディレクトリで同じgitリポジトリをcloneしていて、そちらで削除が反映されない状況に。

下記の1.の説明にあるように、(remoteブランチの追加は自動でされるが)削除されたものはローカルで明示的に削除しないといけないようです。

Delete unneeded branch
$ git clone git://git.kernel.org/.../git.git my.git
$ cd my.git
$ git branch -d -r origin/todo origin/html origin/man (1)
$ git branch -D test (2)

  1. Delete remote-tracking branches "todo", "html", "man". Next fetch or pull will create them again unless you configure them not to. See git-fetch(1).  
  2. Delete "test" branch even if the "master" branch (or whichever branch is currently checked out) does not have all commits from test branch. 

http://www.kernel.org/pub/software/scm/git/docs/git-branch.html

(上によると、git branch -d -r origin/removed_branchでもremoteブランチが削除できるようですね)

###コマンドgit remote show origin, git remote prune origin
git remote辺りにコマンドがあると知ったので見てみると、git remote showがありました。
確認すると、腐りかけた(Stale)tracking branchと表示されています。

shell>>
$ 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
    <<--

そして、pruneで削除。ヘルプには、--dry-runでやるとどのブランチをpruneするかレポートしてくれて、実際のactionはしない旨が記述されているのですが、私の環境では削除されてしまいました。

shell>>
$ git remote prune origin --dry-run
<<--

###Refs
http://www.kernel.org/pub/software/scm/git/docs/git-remote.html
http://www.kernel.org/pub/software/scm/git/docs/git-branch.html
http://reinh.com/blog/2008/04/18/git-push-just-the-tip.html

posted by satoko satoko on Fri 31 Oct 2008 at 12:54 with 0 comments
Contents rssrss
NSAssertやNSLogを無効にする:-DNS_BLOCK_ASSERTIONS=1とNS_BLOCK_ASSERTIONS
GDBでview.frameを表示させる
Core Animationについてのリンク集
[iPhone] new BSDライセンスについてライセンス引用のメモ
Implementing a Container View Controller in UIViewController Class Reference
UITableView用のNSIndexPathの作り方
Xcodeのテンプレート、View-based ApplicationとWindow-based Applicationの違い
CopyOnSelectのLion対応
Xcode4のCode Snippetsを別のPCに移動する+gitで管理する
[iPhone] Singleton: iOS4以降はGCDのdispatch_onceを使う
Tags
iphone開発gitIBInterfaceBuilderiOSSIMBLSnippetsterminaltwitterxcodeXcode4
Comments rssrss
https://rootskitchen.bar/ https://rootskitchen.bar/: Just had a solid session playing the crash format ... 05/18 17:27
guest guest: Optimizar el tiempo durante un viaje de negocios e... 05/18 00:46
https://foolsandkings.bar/ https://foolsandkings.bar/: Wrapped up a cracking night session grinding crash... 05/17 19:23
guest guest: Para muchos turistas, el transporte publico y la l... 05/15 18:22
https://safeedsautotransport.com/ https://safeedsautotransport.com/: Многие пользователи в Узбекистане интересуются, на... 05/13 14:36
evlnwyiyh evlnwyiyh: something new and exciting [url=http://www.gyxb4s... 05/08 11:27
guest guest: The creative community and travel enthusiasts note... 05/07 02:59
https://www.thegameroom.org/online-casinos/100-free-spins/ https://www.thegameroom.org/online-casinos/100-free-spins/: Frisse xxx platforms brengen innovatieve inhoud vo... 05/03 11:12
Services from s21g
YOMU Web小説リーダー
小説投稿サイトの公式ページを開き、WebView表示と読み上げ向け表示を切り替えて、移動中や作業中にもWeb小説の続きを聴きやすくするiPhoneアプリです。
補助探
公開されている補助金・助成金情報を集約し、条件に合う制度を探しやすくするサービスです。
jotter.me
個人開発者のためのホスティング一体型ノートサービス
ハンドミラー
iPhone向けの手鏡アプリ
ツイプロ(twpro)
Twitterプロフィールの高速検索エンジン