ユーザ用ツール

サイト用ツール


サイドバー

Index

はじめてのおつかい






DokuWiki整形記法


PlayGround



development:git

文書の過去の版を表示しています。


git

branchコマンド

git branch

ローカルブランチの一覧を表示

git branch -r

-r、もしくは、–remotes
リモートブランチの一覧を表示

git branch -a

-a、もしくは–all
リモートブランチを含んだブランチの一覧を表示

標準出力に出力

git --no-pager <command> 

log

  • --oneline: 1commit 1行のみログ表示
  • --decorate: branch名、tag名などの別名を表示
  • --graph: revision graphを表示
  • --branches: 他のbranchのlogも表示
  • --tags: tagを表示
  • --remotes: remote branchなどを表示

merge commitを表示しない

git log --no-merges

指定ブランチ間のlogを表示

git --no-pager log <ブランチA>..<ブランチB>

最新の履歴だけを取得

git clone --depth 1 https://github.com/git/git

shortlog

shortlog コマンドは git log の特別なバージョンで、リリースを作成することを目的としています。
作成者別にコミットメッセージの最初の行を表示します。

特定のフォルダのみpull

git init
git config core.sparsecheckout true
git remote add origin リポジトリのURL<https://exsample.com/git/repoitory>
echo I_want/this/folder/ > .git/info/sparse-checkout
git pull origin master

リポジトリの引越し

# git clone --mirror User@oldrepos.example.com:/path/to/Project.git
# git remote set-url --push origin User@newrepos.example.net:/path/to/Project.git
# git push --mirror

ユーザ名・パスワードの設定

~/.netrc
machine github.com
login username
password xxxxxxx

参考

development/git.1595859589.txt.gz · 最終更新: 2020/07/27 23:19 by hayashi