gitあれこれ¶
created at 2019-08-23 07:12+0900
gitignore設定¶
github/gitignore からお手本を拝借する。
A collection of useful .gitignore templates
OSと汎用的に使うテキストエディタ関係の定義はグローバル設定に入れる。
{
echo "##### get from https://github.com/github/gitignore at $(date +'%Y-%m-%d %H:%M:%S'). start ######"
echo "##### MacOS ################################################"
curl -L https://github.com/github/gitignore/raw/master/Global/macOS.gitignore
echo
echo "##### Vim ##################################################"
curl -L https://github.com/github/gitignore/raw/master/Global/Vim.gitignore
echo
echo "##### get from https://github.com/github/gitignore at $(date +'%Y-%m-%d %H:%M:%S'). End ######"
echo
} > ~/.config/git/ignore
プロジェクトごとに使うIDEに合わせてローカルのexcludeへ入れる。
# なかったら作る
ls -la .git/info/exclude
mkdir -p .git/info
# Xcodeの場合
curl -L https://github.com/github/gitignore/raw/master/Global/Xcode.gitignore >> .git/info/exclude
# PyCharmの場合
curl -L https://github.com/github/gitignore/raw/master/Global/JetBrains.gitignore >> .git/info/exclude
echo "#### Python ####" >> .git/info/exclude
curl -L https://github.com/github/gitignore/raw/master/Python.gitignore >> .git/info/exclude
# Anddoid Studioの場合
curl -L https://github.com/github/gitignore/raw/master/Android.gitignore >> .git/info/exclude
# Eclipseの場合
curl -L https://github.com/github/gitignore/raw/master/Global/Eclipse.gitignore >> .git/info/exclude
# Unityの場合
curl -L https://github.com/github/gitignore/raw/master/Unity.gitignore >> .git/info/exclude
プロジェクト固有の無視設定は.gitignoreへ入れる
echo 'mypoem.txt' >> .gitignore
git-secrets を使う¶
See also git-secrets 導入
覚えられないgit コマンド¶
See also git コマンドメモ
参考サイト¶
Gitを使ったバージョン管理|サルでもわかるGit入門【プロジェクト管理ツールBacklog】
ファイルの無視 -- Git - 変更内容のリポジトリへの記録
https://git-scm.com/book/ja/v2/Git-の基本-変更内容のリポジトリへの記録#r_ignoring
Git - gitignore Documentation