Gitコマンドでよく使うやつ、メモっとく。
完全にこれ書いてる自分用だけど、忘れっぽいから書いとく。
git init --bare --shared
git init
git remote add (repo name) URL
git remote -v
git add (file or directory)
git rm (file)
git rm --cached (file)
git commit -m "comment"
git push (repo name) (branch name)
git pull (repo name) (branch name)
git tag (tag name) -m "comment"
git push (repo name) --tags
git pull --tags
git branch (branch name)
git checkout -b (branch name)
git checkout -b (branch name) origin/(branch name)
git branch -a
git log --oneline --decorate --graph
git archive --format=zip --prefix=(prefix name)/ HEAD `git diff --name-only (before commit id) (after commit id)` -o archive.zip
git archive --format=zip --prefix=(prefix name)/ HEAD `git diff --name-only (before commit id) (after commit id) --diff-filter=ACMR` -o archive.zip
git cherry-pick (commit id)
git cherry-pick (before commit id)..(after commit id)
git checkout --theirs (target conflicting file)
git checkout --ours (target conflicting file)
・・・結構あるね。けどやってること自体は割と簡単。
いっぱい書いたから、今後も役だつといいね