linux:git

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
linux:git [2020/02/03 12:34] – [タグ/ブランチ] ともやんlinux:git [2021/03/24 01:49] – [参考文献] ともやん
行 19: 行 19:
  * branch              master     -> FETCH_HEAD  * branch              master     -> FETCH_HEAD
 </code> </code>
 +
 ローカルの master を、リモート追跡の master にリセットする。\\ ローカルの master を、リモート追跡の master にリセットする。\\
 <code> <code>
 $ git reset --hard origin/master $ git reset --hard origin/master
 </code> </code>
 +
 +**Untracked files** を(-d ディレクトリを含めて)削除する。\\
 +<code>
 +$ git clean -df
 +</code>
 +
 +**submodule** の **new commits, modified content** をリセットする。\\
 +<code>
 +$ git submodule foreach --recursive git reset --hard
 +</code>
 +
 +**submodule** の **new commits** をリセットする。\\
 +<code>
 +$ git submodule update --init
 +</code>
 +
 ローカルの状態を確認する。\\ ローカルの状態を確認する。\\
 <code> <code>
行 31: 行 48:
 nothing to commit, working tree clean nothing to commit, working tree clean
 </code> </code>
-===== タグ/ブランチ =====+ 
 +===== タグ/ブランチの使い方 =====
  
 ==== タグ ==== ==== タグ ====
行 171: 行 189:
 ===== 参考文献 ===== ===== 参考文献 =====
 [[http://www-creators.com/archives/1097|git pull を強制し、リモートでローカルを上書きする方法 | WWWクリエイターズ]]\\ [[http://www-creators.com/archives/1097|git pull を強制し、リモートでローカルを上書きする方法 | WWWクリエイターズ]]\\
 +[[https://stackoverflow.com/questions/10906554/how-do-i-revert-my-changes-to-a-git-submodule|How do I revert my changes to a git submodule? - Stack Overflow]]\\
 +[[https://stackoverflow.com/questions/26957237/how-to-make-git-clone-faster-with-multiple-threads|How to make git clone faster with multiple threads? - Stack Overflow]]\\
 +
  
  • linux/git.txt
  • 最終更新: 2023/09/01 13:18
  • by ともやん