##summary When a ip addr is added, two unicat route entries are added to route table.
a host route entry is added to local table. The packet to local host will be routed by this route entry. The route still is valid, even the related interface is shut down.
a connected route is added to main table. It is used to forward the packet to the hosts in the same sub network, it will disappear when interface down
[martin@fc17 git_study]$ git log --oneline 83e7d89 add lineb in readme <== this commit will be reset hardly 4fd6367 add line1 in readme bfd590e touch readme
1 2 3 4 5
[martin@fc17 git_study]$ git reset HEAD^ --hard HEAD is now at 4fd6367 add line1 in readme [martin@fc17 git_study]$ git log --oneline 4fd6367 add line1 in readme bfd590e touch readme
1 2 3
[martin@fc17 git_study]$ cat readme line a 通过git reflog 我们可以得到误删除的commit对应的ID
git reflog
1 2 3 4 5
[martin@fc17 git_study]$ git reflog 4fd6367 HEAD@{0}: reset: moving to HEAD^ 83e7d89 HEAD@{1}: commit: add lineb in readme 4fd6367 HEAD@{2}: commit: add line1 in readme bfd590e HEAD@{3}: commit (initial): touch readme
[martin@fc17 git_study]$ git checkout -b try_recover 83e7d89 Switched to a new branch ‘try_recover’ [martin@fc17 git_study]$ git log —oneline 83e7d89 add lineb in readme 4fd6367 add line1 in readme bfd590e touch readm [martin@fc17 git_study]$ cat readme line a line b
the ‘.show’ method in device_attribute will call the netstat_show, some of the driver read the part of stat from NIC register, but most count the stat by software in dev->stat
1087 git init —bare study.git <=== crate study.git 1088 ls study.git/ 1089 cat study.git/config 1090 ls 1091 git clone study.git/ 1092 ls 1093 cd study 1094 ls 1095 touch study.readme 1096 echo “This is readme for study(master)” 1097 echo “This is readme for study(master)” >>study.readme 1098 git add study.readme 1099 git commit -s study.readme <===== commit a file for test. 1100 git push origin master <===== push them to the server(locally). 1101 cd .. 1102 ls
##create a remote branch.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1103 git clone study.git/ tmp1 1104 cd tmp1/ 1105 ls 1106 git log 1107 cd .. 1108 ls 1109 cd study 1110 ls 1111 git checkout -b dev_junwei <======== create a locally branch. 1112 ls 1113 vim study.readme 1114 ls 1115 git commit study.readme 1116 git mv study.readme study.dev.junwei.readme 1117 git push origin dev_junwei <======== create a remote branch. and remote branch has same name with the local one. 1118 git branch
##create a mirror for the study.git
1
git clone —bare study.git/ mirror.git
##Add a new remote git resp.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
1134 git remote add mirror /home/junwei/git_study/mirror.git/ <=== add a new remote and name it as mirror. 1136 git remote show 1137 git remote show origin 1138 git remote show mirror 1139 git status 1140 git fetch mirror <===== !!!! important, Only thus following checkout could be sucess
1141 git checkout -b m_master mirror/master <=== create local branch according remote branch. 1142 git checkout -b m_dev mirror/dev_junwei
1164 git commit -sa <=== commit a change to local branch.
1168 git push mirror m_dev:dev_junwei <=== push the local change to remote branch. "m_dev" is created in 1142.
1174 git push mirror m_dev:dev_junwei <=== do some change/commit and push again to remote mirror. FU CK( NOT m_dev/dev_junwei)!!!!!!!