Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
60
Help us understand the problem. What is going on with this article?
@knsh14

git submodulesで間違えて追加したときの削除手順

More than 5 years have passed since last update.

先日間違えてgit submodule add してしまったのでコミットする前に全部削除して再度git submodule add しようとしたら

console
A git directory for 'git-tools/git' is found locally with remote(s):            
  origin        https://github.com/git/git.git                                  
If you want to reuse this local git directory instead of cloning again from     
  https://github.com/git/git.git                                                
use the '--force' option. If the local git directory is not the correct repo    
or you are unsure what this means choose another name with the '--name' option.  

と言われ,はまったのでメモ

手順

  1. .gitmodulesから対象のモジュール情報を削除する
  2. .git/configのモジュール情報を削除する
  3. とってきたリポジトリを削除する
  4. .git/modules/以下にあるsubmoduleでとってきたリポジトリを削除する

以上です.
以後はまりませんように

60
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
mercari
フリマアプリ「メルカリ」を、グローバルで開発しています。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
60
Help us understand the problem. What is going on with this article?