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?

More than 5 years have passed since last update.

gitのコマンドをよく忘れるので、自分のメモ用に記録しておく

Posted at

環境

・macOS Catalina 10.15.5
・iTerm2 3.3.11

最初に使うコマンド

git init

最初にコミットする

1.git status
2.git add .
3.git status
4.git commit -v

GitHubにリポジトリを作る

GitHub:https://github.com/

RepositoriesからNew Repositoriesをクリックして作成

remoteリポジトリを登録 git remote add origin https://github.com/ユーザー名/レポジトリ名

githubにpush git push -u origin master

ブランチを切る

ブランチの確認 git branch
開発用(develop)ブランチを切る git branch develop
機能用(feature)ブランチを切る git branch feature

ブランチを切り替える

developブランチに切り替える git checkout develop

作成して切り替えるコマンド
git checkout -b (新ブランチの名前)

ブランチを統合するmasterブランチにfeatureブランチをマージする(Auto merge)

git checkout master
git merge feature 

簡単にこれだけ。
適当だけど、初心者が使うのはこれくらいな気がする

logを見るには
git log

簡単にみるには
--oneline

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?