0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SVN管理のPJをGitLab管理に移行する方法

0
Posted at

はじめに

仕事で、SVN管理のPJをGitLab管理に移行するというタスクがあったので、備忘録的なメモを残しています。

前提

・SVNでPJを管理している。
・GitLabは作成済みで、移行先のPJについても作成済みであること。
・コマンドプロンプトでGit操作が可能であること。

手順

① 適当なフォルダを作成して、そこでコマンドプロンプトを起動
② git svn cloneコマンドを実行して、SVNPJをGit変換しながらクローン

cmd.exe
git svn clone [SVNのリポジトリURL]
例)git svn clone http://123.45.678.90/svn/hogehoge/hoge

③ クローンが完了したら、今いるbranchを確認

cmd.exe
git branch
> * master

④ branchを変更
 ※本PJではmainを主なbranchとしていたため。

cmd. exe
git branch -m master main
>

⑤ branchが変更されたことを確認

cmd.exe
git branch
 > * main

⑥-1 サーバー接続先を確認(originがある場合)

cmd.exe
git remote -v
> origin http://123.45.678.90/svn/hogehoge/hoge (fetch)
> origin http://123.45.678.90/svn/hogehoge/hoge (push)

⑥-2 サーバー接続先を確認(originがない場合)

cmd.exe
git remote -v
> 

⑦-1 サーバー接続先を変更(originがある場合)

cmd.exe
git remote set-url origin http://098.76.543.21/git/hogehoge/hoge
> 

⑦-2 サーバー接続先を変更(originがない場合)

cmd.exe
git remote add origin http://098.76.543.21/git/hogehoge/hoge
> 

⑧ サーバー接続先を確認

cmd.exe
git remote -v
> origin http://098.76.543.21/git/hogehoge/hoge(fetch)
> origin http://098.76.543.21/git/hogehoge/hoge(push)

⑨ GitLabの該当PJを確認し、反映されていることを確認

まとめ

手順は以上です。SVNをクローンする際に、Gitのパスワードを聞かれることがあるので、忘れないようにしましょう。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?