Git
git am パッチの適用。 git am diff.path これを応用して curl -s -L https://patch-diff.githubusercontent.com/raw/cask/cask/pull/392.patch | git am - みたいなこともできる http://blog.a-way-out.net/blog/2015/03/28/github-pull-request-merge/ htt…
git diff master topic_branch > diff.patch patch -p1 < diff.patch diffの取り方はなんでもいい。HEAD~1みたいな書き方でも可能。
こんな感じ。git shortlog を使う。 ➜ kuroko2 git:(master) git shortlog -s -n | head -4 341 Eisuke Oishi 16 Kohei Suzuki 8 shigemk2 7 Naoto Takai Git - git-shortlog Documentation
d.hatena.ne.jp 5人チームだと無料でいける bitbucket.org
npm install -g gitbookからの、 gitbook serve で、ローカルからGitBookの見た目をブラウザで確認出来る。いちおう変更をwatchしてくれるけど、Emacsだと#のファイルが出来てコケる。 github.com
remote: fatal error in commit_refs に遭遇した時どうしたらいいんだろう git gc ネットにつながっているか確認する git push origin master -rしてからgit push origin master いろいろあるけど、僕の場合もう一度pushしたら通ったので、いろいろなパター…
git config --global core.quotepath false ってやるといいんだけど、なんでこの設定にしないといけないんだっていうのが見つからなかったので。 The commands that output paths (e.g. ls-files, diff), when not given the -z option, will quote "unusual…
考えてみると、GitHubというツールは偉大であると同時に不自由でもあるため、パッチのメールを送る時のコマンド群を記す。 事前設定(Gmailの例 送信メールアドレスの設定を~/.gitconfigで) [sendemail] smtpencryption = tls smtpserver = smtp.gmail.com sm…
思い出してきた。 git rev-parse --abbrev-ref HEAD
Git push master fatal: You are not currently on a branch エラーの文章いっぱいでてたけど、最後のコマンドを実行したらばうまく行きました。 fatal: You are not currently on a branch. To push the history leading to the current (detached HEAD) st…
凡ミスの間違い探し。 $ git rebase -i head~2 fatal: Needed a single revision invalid upstream head~2 stackoverflow.com ただしくは、headではなくHEADだ。
#!/bin/bash git remote add upstream $1 これ。毎回git add upstreamするの面倒なので。 qiita.com
git log -p -- delete_test.txt man git-log には以下のように書いてあって、 Show only commits that are enough to explain how the files that match the specified paths came to be. See History Simplification below for details and other simplific…
出涸らしみたいなネタですけども。 Error: Agent admitted failure to sign - User Documentation 鍵が鍵として認識されていないという説。 $ ssh-add ~/.ssh/id_rsa
Git - Git の設定 $ git config --global color.ui true だいたいはtrueで足りるっていう話。
github.com qiita.com もっと使い方を探求せねば。private repoとか。
職場でGitのrefについてお話があって、同僚がこんなコマンドを紹介していました。 $ git fetch git@github.com:sample-user/sample-repo.git '+refs/pull/*:refs/remotes/pr/*' これで、GitHubのPRの情報をローカルに持ってこれます。PRの内容をローカルでチ…
こういうやり方っす。 $ git commit --amend --author "New Author Name <email@address.com>" stackoverflow.com</email@address.com>
わりと最近のgitの機能で、こんなのが追加されたっぽい。 # View commits that will be pushed git log @{u}.. stackoverflow.com ちなみに、このコマンドはcheatコマンド gitで会得した。 github.com
qiita.com 表題のことをしたかったんですが、ってやってもうまくいかないんです。うまく説明できないんですが、git diffはlessっぽい挙動で、awkで拾えないけど、git statusだと結果は標準出力で送られるので、awkで拾えるって言う感じっぽい。 $ git diff |…
stackoverflow.com わりとこれだけ。stashの指定もできちゃう。 $ git stash show -p $ git stash show -p stash@\{0\} とはいえ、stashを多用するのはよくないので、たぶんほどほどに。。。
$ git commit --amend --date="Sat, 14 Dec 2013 12:40:00 +0000" # only author authorだけで、committerは知らない eddmann.com author とはその作業をもともと行った人、committer とはその作業を適用した人のことを指します。あなたがとあるプロジェクト…
ほぼ2年前に通過した場所をもう一度思い出しました。 www.shigemk2.com gist.github.com MacのファイルシステムはCase-sensitiveではないので、たとえばHoge.txtをリネームしてhoge.txtにしても、Gitはファイル名の変更を追跡してくれない(MacみたいなCase-i…
gitリポジトリの複製 - Qiitaqiita.com そのまんまなぞってみる。
差分を-Sでサーチする。 基本形 $ git log -S"import" 詳細 $ git log -p -S"import" ファイル名のみ $ git log -S"import" --stat など。 git logでコミットの差分の中身で絞り込む - Qiitaqiita.com
余計な空白とかを警告してくれる奴。 transitive.info - git diff 使い方 例。
日記です。プルリクを投げました。簡単なものですが。 Add scala-mode dictionary by shigemk2 · Pull Request #398 · auto-complete/auto-completegithub.com そういえば、auto-completeのdictにScalaが入っていないなあ、ENSIMEとscala-modeは相性が悪いな…
オンラインのコミュニケーションは難しいよねっていう話 プルリクはわかりやすく、読みやすく書く(無言はよくないよ) 命令口調よくない GitHub「完璧なプルリクの書き方を教えるぜ」 - Qiitaqiita.com 余計な改行とか余白とかはよくない とは言え、バグが出…
通常、git cloneしたリポジトリのファイルのタイムスタンプは、cloneした日付である。 でもファイルのタイムスタンプを実際に編集した時、せめてコミットしたときまで復元したいときってあるよね。あると思う。 実際に見てみると、ああ^~って感じのシェル芸…
そのままなので、解決方法は不明です。