LoginSignup
0
2

More than 5 years have passed since last update.

Gitのケース別の使い方

Posted at

目的

gitでこういうことが起こった時、こうしたいときどうするかをまとめる。

レポジトリから履歴とかは消してコードをコピーしたい

想定ケース

コードのみを持ってきてそれまでの過程とかは無視したい。また元のレポジトリと全く別管理で動かしたい。

# cloneしてくる

git clone git@github.com:a.git hoge

# 一度削除してgitを入れ直す
rm -rf .git
git init

# pushしなおす

git add .
git commit -m "Initial commit"
git remote add origin git@github.com:b.git
git push
0
2
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
2