LoginSignup
0
2

More than 5 years have passed since last update.

Git覚書(Git Bash)

Last updated at Posted at 2019-03-23

基本操作

Sourcetreeは、ssh設定でつまずいたので、主にGit bashを利用しています。

カレントディレクトリの確認

"~"がカレントディレクトリを表す。

$ echo ~

【初期設定】ホームディレクトリ変更

  1. GitBashのショートカットを作成
  2. プロパティ→ターゲットフォルダか何かを、変更したいディレクトリに変更。

ディレクトリを消去

$ rm -r <directory name>

-rは再帰的に消去(nested folder)、-fは確認せずに消去。

コミット・プッシュ関連

Clone: リモート(僕の場合はGithub)からコピー

$ git clone http://github.com/xxx/xxxx.git

ローカルへコミットするため、ファイルを登録(subversionでmodified/add/deleteとかの属性に対応)

$ git add <file name>

自分のローカルレポジトリの状況を確認

$ git status

ローカルへコミット

$ git commit -m "commit message"

リモートへプッシュ

$ git push origin <ブランチ名>

コミット履歴を確認

$ git log
0
2
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
2