LoginSignup
0
1

More than 1 year has passed since last update.

Gitlab 操作メモ

Last updated at Posted at 2021-10-07

間違ってコミットしたファイルを削除する。

git rm <file-name>

ローカルにブランチを作って、リモートブランチを作る

git checkout -b newBranch コピー元ブランチ

git checkout -b feature/rooting develop ←developブランチからfeature/rootingブランチを作成
git push -u origin feature/rooting  ←ここでリモートブランチが作られる

直前のコミットメッセージを修正する

git commit --amend -m "修正後のメッセージ"

マージ済のブランチを確認する

git branch --merged

不要になったローカルブランチを削除する。もしくは間違えて作ったローカルブランチを削除する

git branch -d localBranch

間違えてローカルブランチからリモートリポジトリに登録したリモートブランチを削除する

git push --delete origin remoteBranchName

マージコミット(枝分かれ)を残してマージする

git checkout マージ先のブランチ名
git merge --no-ff マージ元のブランチ名

カレントブランチをリモートブランチにpushする。

git push origin HEAD
A handy way to push the current branch to the same name on the remote.
0
1
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
1