Help us understand the problem. What is going on with this article?

gitレポジトリの場所をうつしたい

More than 1 year has passed since last update.

概要

まだgit使い始めだった頃にアホな場所にgit initしてしまい、それが今になって不便になったので「gitレポジトリの場所を移したい!」ってなって色々調べたけど結局時間の無駄だったというお話。

移す前

java/
├── .git
├── .gitignore
├── cat.java
└── ls.java

望んでいた結果

src/
├── .git
├── .gitignore
├── main
│   ├── java
│   │   ├── cat.java
│   │   └── ls.java
│   ├── resources
│   └── test
│       └── file
└── test
    └── java
        └── lsTest.java

解決策

srcディレクトリにcdした後、.gitと.gitignoreをmvして持ってくる

$ mv main/java/.git main/java/.gitignore .

そんでadd, commit & pushするだけ!!
超簡単。

解決への経緯

stack overflowのこのページを主に参考にしながら格闘していたが、全然うまくいかない。
他にもそれらしいことが書いてあるページを読んでみても全然できない!
やけになって「.gitうつしたる!」っていざやってみたらなんかうまく行ってしまった。
.
.
.

(´・ω・`)

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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした