<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nonylene</author_name>
  <author_url>https://blog.hatena.ne.jp/nonylene/</author_url>
  <blog_title>Unyablog.</blog_title>
  <blog_url>https://nonylene.hatenablog.jp/</blog_url>
  <categories>
    <anon>Git</anon>
  </categories>
  <description>Git でトピックブランチを切るときに、元ブランチで git pull し忘れて古いコミットから生やしてしまうときがある。 最新の変更を認識できなかったり、後々コンフリクトが起きたりと不便なことがままあるので、 Commit 前に HEAD がリモートリポジトリの HEAD から派生しているかを確認するスクリプトを書いてみた。 Git には Commit 前に pre-commit hook を実行することができる。そこで non-zero code で exit すれば Commit 処理が中止されるので、これで防ぐようにする。 コード これを .git/hooks/pre-commit 内…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnonylene.hatenablog.jp%2Fentry%2F2022%2F02%2F01%2F141614&quot; title=&quot;Git でブランチがリモートリポジトリの HEAD から派生しているかどうかを確認する - Unyablog.&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-02-01 14:16:14</published>
  <title>Git でブランチがリモートリポジトリの HEAD から派生しているかどうかを確認する</title>
  <type>rich</type>
  <url>https://nonylene.hatenablog.jp/entry/2022/02/01/141614</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
