うちのいぬ Tech Blog

Tech Blog of Uchinoinu/My dog

Git

gitでタグをチェックアウトする

gitを使ってバージョンコントロールをする上で、GitHubのRelease機能を利用したりしてgitのtagは作成したものの、そのtagを打った際のコードに戻る(チェックアウトする)ことが少なかったので、その方法などを改めて確認しておきます。 タグ一覧を確認 git …

Git command for Deploy or PR merging

Diff of changed files $ git diff --stat commit-new commit-old $ git diff --stat --name-only commit-new commit-old $ git diff --stat --ignore-blank-lines commit-new commit-old Diff of content of file $ git diff commit-old commit-new -- path…

デプロイ前のログや差分をチェックするgitコマンド

変更したfileの抽出 $ git diff --stat commit-new commit-old $ git diff --stat --name-only commit-new commit-old $ git diff --stat --ignore-blank-lines commit-new commit-old fileの変更差分 $ git diff commit-old commit-new -- path/to/file 差…

Add pre-commit action before git commit to prevent me from getting in trouble.

初心者がAWSに手を出して$6,000請求されて、泣きそうになったお話 を読んで、わたしもきっとやるだろうなぁと思い、とりあえず自動でチェックしてもらうスクリプトだけでも入れておこうと思いました。 1. Git Templates $ git config --global init.template…

Git trouble: commit file size become too bigger

Git

Generating Rails project, and come to phase to commit it. The file size is even more than my expectation. $ git push origin master Counting objects: 26593, done. Delta compression using up to 4 threads. Compressing objects: 100% (24906/249…

.gitignoreが反映されない場合の対応

リポジトリに.gitignoreが追加されていると、 そのキャッシュが残ってしまい、 変更を加えた.gitignoreが反映されない様です。 なのでgitからキャッシュを削除すればいいはず。 ↑これで反映される様になりました。