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のコマンドの使い方

0
Last updated at Posted at 2026-10-18

まずはclone

clone前準備

個人のGitlabのアイコンをクリック

image.png

Preferencesをクリック

image.png

personal access tokensをクリック

image.png

generate tokenをクリック

image.png

Legacy tokenでいいと思います。
期間は最大で1年です。
とりあえず権限はすべてチェック入れていいと思います。

tokenのパスワードをきちんと保管しましょう。
後で使います。
パスワードなくしたら再度作りましょう!!

プロジェクトのurlの場所もコピーしておいてください、後で使います。

image.png

# ファイルをコピーしたいディレクトリ作成
mkdir git 

# 移動する
cd git

# Gitlabなどから

git clone http://kenken:glpat-Ytl4LH1Wy8e2pFUbw2RVs286MQp1OjQH.01.0w0p0kznc@192.168.2.176/root/my-docker-app.git
※最後の.gitはあってもなくても保管してくれるはず

# すいません、ブランチはGUIで作成済みを想定
# ブランチ確認
git branch -a

#作成したブランチに移動
# 「図書館の貸出」の意味のcheckout 退室の意味ではない
git checkout testbranch

#ファイル作成
touch kenken.txt

# いったんローカル保存 段ボールにつめました
git add .

# コメントを入れます。これがGitLab上に残ります 
git commit -m "First Commit"

# 名前を設定します。自分だけの環境なら以下を設定しておいたほうが良いです。
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

# テストブランチへの追加します。
git push http://kenken:glpat-tahpR5iUQp40ygc3tAhJkG86MQp10jQH.01.Ow07g9dti@192.168.2.176/root/my-docker-app.git testbranch

あとはマージリクエストGUIで出してください。

あとがき

サーバ上からやっているだけどブランチ作るところと、マージ部分はGUIなんだからすべてGUIでやれよって話かなーっと
そうすればメール設定なんかも要らないし

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?