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】クローンの手順(PuTTY版)

Posted at

🧭 概要

GitのクローンをPuTTY環境で行う手順をまとめました。

🎯 目標

Gitのクローンを出来るように想定します。

🪜 手順

1️⃣ 配置したいディレクトリに移動すること。

qiita.rb
cd pathname

例:

qiita.rb
[user@server ~]$ cd /opt
[user@server opt]$

2️⃣ 配置場所にクローンを行うこと

※基本選択されるブランチは master ブランチ

qiita.rb
sudo git clone https://example.backlog.com/git/PROJECT_REPO/ui.git myfoldername

例:

qiita.rb
[user@server opt]$ sudo git clone https://example.backlog.com/git/PROJECT_REPO/web.git project-web

3️⃣ 配置場所にブランチを選択し、クローンを行うこと。

qiita.rb
sudo git clone -b branchname https://example.backlog.com/git/PROJECT_REPO/ui.git myfoldername

例:

qiita.rb
sudo git clone -b develop-branch https://example.backlog.com/git/PROJECT_REPO/ui.git project-ui-backup

4️⃣ クローンした内容を確認すること。

qiita.rb
ls

例:

qiita.rb
[user@server opt]$ ls
aws  project-file  project-ui  project-ui-backup  project-web  target  ui  web

✅ ディレクトリ内に作成された場合、クローンの手順は完了です。

🧩 補足

sudo を使う理由:EC2などの環境では権限エラーを回避するため。

-b オプションは特定のブランチを直接クローンしたい場合に利用します。

クローン後にブランチを切り替える場合は以下のコマンドも使用可能:

qiita.rb
git checkout branchname

🏁 まとめ

・PuTTY経由でGitクローンを行う流れは以下の通りです:

・cdで作業ディレクトリに移動

・git cloneでリポジトリを取得

・必要に応じて-bオプションでブランチ指定

・lsで内容確認

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?