git add の結果を取り消す方法
1 |
$ git reset HEAD mistake.txt |
補足 : ステージングの情報をリセットするだけ。ワーキングやコミットには影響しない。
下記のようなコマンドを実行すれば、コミットもワーキングもリセットする(コミット前に戻す)ことになる。
1 |
$ git reset --hard HEAD^ |
git add の結果を取り消す方法
1 |
$ git reset HEAD mistake.txt |
補足 : ステージングの情報をリセットするだけ。ワーキングやコミットには影響しない。
下記のようなコマンドを実行すれば、コミットもワーキングもリセットする(コミット前に戻す)ことになる。
1 |
$ git reset --hard HEAD^ |
git remote add コマンドを実行するとエラーとなる。
1 2 |
$ git remote add origin https://JaneDoe@dev.azure.com/JaneDoe/MyRepository/_git/MyRepository fatal: remote origin already exists. |
Windows形式の改行コード (CR+LF) の表示 ^M を抑止する方法
下記の例のように行末の ^M が目障りである。
1 2 |
-// Created on: 2019/01/26 9:22:59 +// Created on: 2019/01/26 10:04:07^M |
^M == CR == 0x0A
1 |
$ git config --local core.whitespace cr-at-eol |
1 |
$ git config --local --unset core.whitespace |
robocar store から購入したSD cardにインストールされているOSイメージ
d2.local
pi
asdfasdf
1 |
$ ssh pi@d2.local |
1 2 3 4 5 6 |
$ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 8.0 (jessie) Release: 8.0 Codename: jessie |
プログラミング言語 C++ における演算子オーバーロードの糖衣構文的な解釈と、フレンド関数による解決
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
#include <iostream> using namespace std; class coord { int x, y; public: coord() : x(0), y(0) {} coord(int i, int j) : x(i), y(j) {} void show() { cout << "x = " << x << ", y = " << y << endl; } coord operator+(coord position); coord add(coord position); }; coord coord::operator+(coord position) { coord temp; temp.x = this->x + position.x; temp.y = this->y + position.y; return temp; } coord coord::add(coord position) { coord temp; temp.x = this->x + position.x; temp.y = this->y + position.y; return temp; } int main() { coord position_a(10, 10), position_b(5, 3); coord position_m = position_a + position_b; position_m.show(); // => x = 15, y = 13 coord position_n = position_a.add(position_b); position_n.show(); // => x = 15, y = 13 return 0; } |
※ 説明をシンプルにするために参照渡しやconst修飾は省略しています。
ワークツリーからファイルエクスプローラやrmコマンドで削除した複数のファイルをgitの追跡対象からも一括して削除する方法
1 |
$ git rm `git ls-files --deleted` |
上記コマンドでファイル削除操作がステージング(インデックス)に登録される。
ステージングの結果がOKであれば git commit を実行する。
Robocar Store から購入した "Donkey Car Starter Kit" の DC/DCコンバータ(電源ボード)の操作スイッチとLEDの説明です。
Robocar Store から購入した "Donkey Car Starter Kit" のベースプレート(Raspberry Piなどの電子基板を車体に固定するアクリル板)をラジコンカーの車体に固定する方法
開封直後。ラジコンカーのオリジナルのボディーが車体に載った状態です。
ボディーの前後4箇所を金属ピンで簡単に止めているだけです。
linuxで xxx.tar.gz を展開すると「未知の拡張ヘッダキーワード」エラーが大量に出力される。
1 2 3 4 |
tdiary-v5.0.10/benchmark/benchmark_io_default.rb tar: 未知の拡張ヘッダキーワード `SCHILY.dev' を無視 tar: 未知の拡張ヘッダキーワード `SCHILY.ino' を無視 tar: 未知の拡張ヘッダキーワード `SCHILY.nlink' を無視 |