LoginSignup
0
0

More than 3 years have passed since last update.

Gitリポジトリの状態を保存しておき、あとで再利用する

Posted at

コードを再利用したい

わたしは、よくpyramidというpythonのフレームワークを使います。
フレームワークですがいらないところや、自分好みのカスタマイズを毎回リポジトリに対して行っていました。
思ったのですが、これ業務コード書き始める前まで取っておけばよくね。
と、思ったのでリポジトリをコピーする方法をまとめておきます

リポジトリを保存する

いい感じのところまでフレームワークの調整をします。
自分好みのところまで。

今回は、mapというリポジトリを、pyramid_initialという名前で保存しておきます。
pyramid_initialというリポジトリを作成しておきます

git clone --bare https://github.com/noracorn/map.git
cd map.git/
git push --mirror https://github.com/noracorn/pyramid_initial.git
cd ..
rm -rf map.git

保存先のリポジトリをクローンして使う

リネームの処理

git clone https://github.com/noracorn/pyramid_initial.git
cd pyramid_initial
git grep -l map | xargs gsed -i "s#map#pyramid_initial#g"

pyramid特有の処理

mv map pyramid_initial
mv map.egg-info
pip install -e .
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0