yuuho.wiki

カオスの欠片を集めて知恵の泉を作る

ユーザ用ツール

サイト用ツール


tips:git:start

差分

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

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
tips:git:start [2024/07/22 01:03] – [コミットを作らず差分の共有をする] yuuhotips:git:start [2025/06/23 19:31] (現在) – [branch を扱う] yuuho
行 36: 行 36:
   * repository (commit)   * repository (commit)
  
-<code>git diff</code> は workdir と staging の比較。\\ +  * <code>git diff</code> は workdir と staging の比較。\\ 
-<code>git diff --cached</code> は repository と staging の比較。+  <code>git diff --cached</code> または <code bash>git diff --staged</code> は repository と staging の比較。
  
  
行 60: 行 60:
 </code> </code>
  
-特定のディレクトリ以下について調べる場合は ''git diff --relative=hogedir'' で指定+特定のディレクトリ以下について調べる場合は ''git diff --relative=hogedir'' で指定。 
 + 
 +patch も base64 で共有するのが良いかも。空白などの情報が大切みたい。 
  
  
行 69: 行 72:
   * 最初に現在の状態を bundle にする。 <code bash>git bundle create v00_first.bundle master</code>   * 最初に現在の状態を bundle にする。 <code bash>git bundle create v00_first.bundle master</code>
   * 他の環境で bundle を復元 <code bash>git clone v00_first.bundle repo_name</code>   * 他の環境で bundle を復元 <code bash>git clone v00_first.bundle repo_name</code>
 +    * 場合によっては ディレクトリに入ってから ''git pull origin master'' しないといけない?
   * 作業している環境で新しいコミットを作る <code bash>git add hogehoge   * 作業している環境で新しいコミットを作る <code bash>git add hogehoge
 git commit -m "hogehoge"</code> git commit -m "hogehoge"</code>
   * 差分だけを bundle 化。<code bash>git bundle create v01_diff.bundle HEAD~1..HEAD</code>   * 差分だけを bundle 化。<code bash>git bundle create v01_diff.bundle HEAD~1..HEAD</code>
-  * +  * 別環境で差分 bundle を pull <code bash>git remote add diff_commit /path/to/v01_diff.bundle 
 +git pull diff_commit HEAD</code> 
 + 
 + 
 + 
  
  
行 152: 行 161:
 === 設定を確認する === === 設定を確認する ===
 <code bash>git config --get hoge.fuga.piyo</code> <code bash>git config --get hoge.fuga.piyo</code>
 +
 +=== 設定を消す ===
 +<code bash>git config --unset hoge.fuga.piyo</code>
  
  
行 223: 行 235:
 git commit -m "取り込み" git commit -m "取り込み"
 </code> </code>
 +
 +===== コマンド =====
 +
 +==== add したものの確認 ====
 +<code bash>git diff --cached</code>
 +
tips/git/start.1721610203.txt.gz · 最終更新: 2024/07/22 01:03 by yuuho