1
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?

簡単コマンドライン(pytest, docker, git)

Last updated at Posted at 2025-01-21

はじめに

pytest, docker, gitの備忘録です。
(わすれたらココ見ろ俺。)

pytest optinon

標準出力:

pytest - s ./test_hoge.py

docker 系コマンドチートシート

// dockerデーモン起動
sudo service docker start
// dockerデーモンステータス確認
sudo service docker status
// イメージからコンテナの起動+接続
docker run -it イメージ名 bash
// 起動済みコンテナへ接続
docker exec -it コンテナ名 bash  
//Current Directory内のDockerfileをビルドしてイメージ作成
docker build ./
// コンテナの停止
docker stop コンテナID 
// コンテナの再起動
docker restart コンテナ名

git 系コマンドチートシート

忘れがちなGitチートシート

// ローカルに存在するブランチの一覧を表示
git branch
// 指定したブランチに切り替える。
git branch {ブランチ名}
// 新しいブランチを作成して、そのブランチに切り替える。
git checkout -b {ブランチ名}
//  指定したブランチを現在のブランチにマージする。
git merge {ブランチ名}
// リモートリポジトリから変更を取得してマージする。
git pull {リモート名} {ブランチ名}
// . ローカルのブランチをリモートへの登録
git push -u origin {作成するリモートブランチ名}
// コミットにまとめたいファイルをステージングエリアへ
git add [ファイル名/ディレクトリ名/--all/-A]
// ファイルステータス確認(コミットの対象を確認)
git status
// コミット
git commit -m "[コミットコメント]"
//  ローカルのブランチをリモートリポジトリにプッシュする。
git push {リモート名} {ブランチ名}
// プルリクエストの内容をローカルに落とす
git fetch origin pull/{PR_ID}/head:{BRANCHNAME}

たとえば、git fetch origin pull/20/head:PR-20

// リモートに反映されているbranchをローカルにおとs
git pull origin {REMOTE-BRANCH-NAME}:{LOCAL-BRANCH-NAME}
1
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
1
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?