過去の特定のコミットからブランチを作成する方法
書式
|
1 |
git checkout <rev> -b <branchname> |
実行例
|
1 |
$ git checkout 6bf73e8 -b my_new_branch |
過去の特定のコミットからブランチを作成する方法
|
1 |
git checkout <rev> -b <branchname> |
|
1 |
$ git checkout 6bf73e8 -b my_new_branch |
|
1 |
$ git tag タグ名 |
|
1 |
$ git tag v.1.10 |
フォルダを移動した/リネームしたファイルの履歴が(通常操作では)途切れる。
--follow オプションを付加する
Continue listing the history of a file beyond renames (works only for a single file).
Git において、日本語のファイル名やパス名が化ける。
|
1 2 3 4 5 6 7 8 9 10 |
$ git status On branch master No commits yet Untracked files: (use "git add <file>..." to include in what will be committed) "\343\201\212\350\252\255\343\201\277\343\201\217\343\201\240\343\201\225\343\201\204.txt" nothing added to commit but untracked files present (use "git add" to track) |
|
1 2 3 4 5 6 |
$ git stash pop Auto-merging inc/foo.h CONFLICT (content): Merge conflict in inc/foo.h Auto-merging src/bar.c CONFLICT (content): Merge conflict in src/bar.c The stash entry is kept in case you need it again. |
git blame を実行すると Not Committed Yet が発生する。(blameが期待した通りに実行できない)
|
1 2 3 4 5 6 |
000000000 (Not Committed Yet 2019-09-02 20:47:07 +0900 1) /////////////////////////////////////////////////////////// 000000000 (Not Committed Yet 2019-09-02 20:47:07 +0900 2) // Sample.h 000000000 (Not Committed Yet 2019-09-02 20:47:07 +0900 3) // Implementation of the Class Sample 000000000 (Not Committed Yet 2019-09-02 20:47:07 +0900 4) // Created on: 2019/07/11 21:24:22 000000000 (Not Committed Yet 2019-09-02 20:47:07 +0900 5) // Original author: Jane Doe 000000000 (Not Committed Yet 2019-09-02 20:47:07 +0900 6) /////////////////////////////////////////////////////////// |
|
1 |
$ git diff --stat hash1 hash2 -- "*.c" "*.cpp" "*.h" |
|
1 |
$ git diff --stat hash1 hash2 -- ":(exclude)*.xlsx" |
インストール済みの git for windows をバージョンアップする方法
Git Bash や コマンドプロンプト などから、アップデートコマンドを実行する。但し git for windows 2.1.3 以前はアップデートコマンド非対応。
|
1 |
$ git update-git-for-windows |
その後、GUIウィンドウがポップアップので指示に従ってインストールを進める。
|
1 2 3 4 5 6 |
$ git fetch remote: Azure Repos remote: We noticed you're using an older version of Git. For the best experience, upgrade to a newer version. remote: Found 9 objects to send. (504 ms) Unpacking objects: 100% (9/9), done. ... |
|
1 |
$ git config --show-origin credential.helper |
.git-credentials)保存
https://github.com/microsoft/Git-Credential-Manager-for-Windows