<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Git on makotow's blog</title><link>https://blog.makotow.net/tags/git/</link><description>Recent content in Git on makotow's blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Tue, 08 Aug 2017 15:34:00 +0000</lastBuildDate><atom:link href="https://blog.makotow.net/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>Git のサブコマンドを実装する</title><link>https://blog.makotow.net/2017/08/08/git-%E3%81%AE%E3%82%B5%E3%83%96%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%82%92%E5%AE%9F%E8%A3%85%E3%81%99%E3%82%8B/</link><pubDate>Tue, 08 Aug 2017 15:34:00 +0000</pubDate><guid>https://blog.makotow.net/2017/08/08/git-%E3%81%AE%E3%82%B5%E3%83%96%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%82%92%E5%AE%9F%E8%A3%85%E3%81%99%E3%82%8B/</guid><description>ユーティリティや他システム連携の準備 背景 git のサブコマンドで任意の動作、例えばワークフローをまとめてみたり、外部のプログラムやAPIを呼び出すことをやりたかった。
実現する方法 まずは基本を確認、gitのサブコマンドの実装方法に調べた。
パスが通っている場所に git-XXというファイル名で配置
ファイルはバイナリでも、スクリプトファイルでもよい。
この仕組みを取ることで git xxx arg1 arg2のように Git のサブコマンドとして使用可能になる。
できること 一連の git ワークフローをまとめる Git コマンドの裏側で何かしらの処理をさせる 今回は実験的に「一連の git ワークフローをまとめる」を実装。
本来は「Git コマンドの裏側で何かしらの処理をさせる」をできるようにしたい。
出来上がったもの makotow/dailyutils シンプルに git のリポジトリをミラーするもの。
$ git mirror src_repo dest_repo でgit repository をコピーするもの</description></item></channel></rss>