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?

【備忘録】Gitで自分のサーバ上にリモートレポジトリを作成してローカルリポジトリに設定する方法

Posted at

Android Studio上で作成したプロジェクトをバージョン管理するために記録

【前提条件】
・すでにPC内にGitがインストールされていること前提
・Windowsで作業している
・ローカルレポジトリには

手順
1.エクスプローラーを開き適当なパスに移動してリモートレポジトリ
  を入れるフォルダを作成

2.作成したフォルダを開いて右クリックを押してGitBushを立ち上げる

3.GitBushにリモートレポジトリを作成するためのコマンドを打つ
  git init --bare --shared=true

4.GitBushにリモートレポジトリを設定しようとしているローカルレポ
  ジトリのパスまで移動するためのコマンドを打つ
 cd <ローカルレポジトリまでのパス>

5.GitBushにローカルレポジトリにリモートレポジトリを設定するため
  のコマンドを打つ
 git remote add origin file:/<作成したリモートレポジトリのパス>

ローカルレポジトリにリモートレポジトリを設定するのは完了

GitBushにリモートレポジトリからクローンを作成するコマンドを打てば最新状態のレポジトリを取得できる

手順
1.まずはGitBushにクローンを作成したい場所まで移動するコマンドを打つ
  cd <クローンを作成したい場所のパス>

2.クローンを作成するためのコマンドを打つ
  git clone <リモートレポジトリのパス>

完了!

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?