gitでブランチ変更するたびにvimで開いてたバッファが実ファイルと違ってしまうのでいつもqa!して開きなおしてた。

atomだとデフォルトで読み込みなおしてくれるのでいいよなと思ってました。

git - Refresh all files in buffer from disk in vim - Stack Overflow

bufdo e!すればいいらしい。

カワイイヤッター!

下記のブログのエントリーのお陰でで解決。感謝です。

Gitでリモートブランチを消してもgit branch -aに出てくる件 - chulip.org

確かにgit fetchのmanには書いてあるんだけど、git branchのmanを見に行っちゃうし、多すぎてどこのman見に行けばいいのかわからない。

まあ俺は一生gitをマスターすることができないんだろうな・・・。

% git fetch --prune
 x [deleted]         (none)     -> origin/add-random-featured
 x [deleted]         (none)     -> origin/add_partial
 x [deleted]         (none)     -> origin/award-badge
 x [deleted]         (none)     -> origin/boards_anonymous_comment
 x [deleted]         (none)     -> origin/change-story-end-menu-link-from-featured-to-top
 x [deleted]         (none)     -> origin/convert-comic-frames
 x [deleted]         (none)     -> origin/cookie-error
 x [deleted]         (none)     -> origin/css-bug-in-read-comics
 x [deleted]         (none)     -> origin/delete_comments
 x [deleted]         (none)     -> origin/en-add-help-mokuji
 x [deleted]         (none)     -> origin/enable-comment-from-cross-domain
 x [deleted]         (none)     -> origin/exclude-authors-comments-from-recents
 x [deleted]         (none)     -> origin/extract-simple_seed
 x [deleted]         (none)     -> origin/feature-disable-anonymous-comments
 x [deleted]         (none)     -> origin/fix-red-button-in-urban-legend
 x [deleted]         (none)     -> origin/ignore-violation
 x [deleted]         (none)     -> origin/iphone-icon-120
 x [deleted]         (none)     -> origin/look-back-mode
 x [deleted]         (none)     -> origin/modify-thank-you-mail
 x [deleted]         (none)     -> origin/more_users_info
 x [deleted]         (none)     -> origin/notice-tag-by-email
 x [deleted]         (none)     -> origin/oulu-setup
 x [deleted]         (none)     -> origin/poltergeist
 x [deleted]         (none)     -> origin/rails4.1.1
 x [deleted]         (none)     -> origin/random-story
 x [deleted]         (none)     -> origin/remove_link
 x [deleted]         (none)     -> origin/rmlink
 x [deleted]         (none)     -> origin/scarystory
 x [deleted]         (none)     -> origin/show-spoiler-checkbox-only-on-comic-and-story-pages
 x [deleted]         (none)     -> origin/update-rails-from-3.2-to-4.0

とにかくスッキリしました。

仕事で使うprivateなreposへのPRはforkしちゃうと全員有料アカウントが必要になっちゃうから同一reposに別branchを作ってそこからmasterにPRを送る。

これのコマンドが面倒で、

$ git pull-request -b fjordllc/master -h fjordllc/something

みたいに長い。これだけだったらC-rのhistory保管使えばいいんだけど、別の仕事も並列してやってる時に面倒。

$ git pull-request -b othercompany/master -h othercompany/something

history保管だとこれの切り替えがダルい。zsh保管とかaliasとかで何とかならないかなあ。

追記

ファッ!?

-bで送り先のブランチ指定できる。

% git pull-request -h fjordllc:remove_a_space -b fjordllc:kowabana_net

fjordllc ← organization名

remove_a_space ← 今回作ったブランチ名

kowabana_net ← masterじゃない送り先ブランチ名

GitHub の Issue をあとから Pull Request にする (あとからコードを添付する) #git #hub #Github - Qiita

怖話の場合は下記。(brewでhubをインストールしておく)

% git pull-request -h fjordllc:new-category

日本語ファイル使ったことなかったけど、レガシー改善でsvnからgitへ移行したら日本語ファイル沢山。

Command Line Toolsで入ってるgitは若干古い。

% git version
git version 1.7.10.2 (Apple Git-33)

1.7.12から日本語ファイル名(UTF-8-MAC)が扱えるようになってるのでbrewで入れる。

% brew info git
git: stable 1.7.12.1, HEAD
% brew install git

実験的な機能という位置付けらしいのでデフォルトではオフになってる。オンにする。

% git config --local core.precomposeunicode true 

マシン全体でオンにしたい場合は下記。

% git config --global core.precomposeunicode true 

参照:git 1.7.12でUTF8-MAC問題が解決 « Butaman-kun Project

branch名を変更する

% git branch -m old_branch new_branch

git addしたが戻したい

git reset HEAD /path/to/file

色々変更しちゃったけど特定の変更に関するファイルだけ別のcommitにしたい

% git app -p

対話的なモードになるのでy, nなどでstageしたいものだけ選んでいく。最後に普通にgit commitする。

上記プラス1ファイル内に関係無い別々の変更点があるのでそれも別のcommitにしたい。

対話モード中に1ファイルのdiffが一気に表示されるがそこでs(plit)を押せば個別にy, nできる。後は同じ。

# config/deploy.rb
set :git_shallow_clone, 1

Added --depth 1 option to deploy command if use this setting.

$ apt-cache search git-core
git-core - fast, scalable, distributed revision control system (obsolete)
git - fast, scalable, distributed revision control system

へー。Debian Squeezeではgit-coreはgitかー。

Lokka Config [Jenkins]

"Trigger builds remotely"を選んで適当なTOKENを設定する。

Githubの"Post-Recieve URLs"にそのURLを設定する。

http://example.com/job/PROJECT_NAME/build?token=TOKEN

追記:

Github Pluginを0.5にアップしたらチェックボックスが出現してもっと簡単になりました!

Lokka Config [Jenkins]

追記2:

と思ったら上手くいってませんでした。何がどう動いてるのが理解出来てない感じ・・・

Configure System [Jenkins]

verifyと出るけどgithubにpushしてもbuildされない状態。以前のやり方に戻そうかな?