./repo
forall -c "git checkout korg/xxx -b xxx_1205"
|
這是利用repo去把每個子資料夾下的.git的branch全部一起切換到某個你想要的branch
-b就是另外命名為xxx_1205,
我習慣在後面加上日期, 1205就是12月5號
|
grep
-winsrC3 'xxx' ./*
|
這個會去搜尋當前目錄下所有檔案*/
-s:
suppress error messages 不顯示error message
-r:
recursive 子目錄一起搜尋
-i:
ignore case distinctions 忽略大小寫
-n: print
line number with output lines 印出行號
-w: force
PATTERN to match only whole words 只match整個字
-C3:
多顯示上下各3行
|
adb
logcat -v time | grep -i 'bt\|blue'
|
透過logcat丟給grep去尋找多個字串bt和blue,且忽略大小寫,
並且印出時間
|
adb shell
cat /proc/kmsg
adb shell
cat self/maps
adb shell
cat kallsyms | more
adb shell
cat zoneinfo
|
看kernel的log
看user
space的process
看kernel
symbol table
看physical
memory
看virtual
memory & peripheral的mapping狀況
|
adb
reboot bootloader
|
讓手機進去fastboot
mode
|
adb
remount
adb push
/xxx/yyy.so aaa/bbb
|
把某個檔案放到手機裡面,如果出現failed
to copy...: Read-only file system
打 adb
remount,然後再做一次就可以了
放音樂檔到手機裡,路徑是
sdcard/Music
|
find .
-path '*/res/values/config.xml'
find .
-iname '*config'
find .
blue*
|
尋找路徑
尋找有config檔名的
尋找當前目錄下blue開頭的檔案
|
adb shell
pm list package -f
|
進到adb
shell裡面之後
利用pm list
package去list出所有的package
-f 是print
all information
|
git
gerrit for/xxxbranch
|
請注意,這個會隨著branch
變更而變更,就會把code進到gerrit啦
|
git-bugzilla
pull
|
可以幫你把tracker
id 抓下來
|
git
commit -a
|
就會帶入bugzilla
相關的info..上code的目的是解tracker issue就選擇所屬的issue id, 否則直接Finish即可
會出現bug
list的dialog, 可以略過staging area
如果沒有出現dialog畫面,
就先執行下面兩行
$ sudo
apt-get install dialog
$ sudo
apt-get install libwww-mechanize-perl
先update
找自己的bug
ID,修改成solved,最後按下finish
輸入root
cause:...按Enter之後
會跳出一個editor,這時可以把你要讓別人看到的那行#拿掉
再按Ctrl+o
(write out), 會出現File Name To Write: .git/COMMIT_EDITMSG, 按Enter
Ctrl+x
(exit)
|
git am
0001-XXX.patch
|
把你的第一個patch
進到這個branch , 完成後,打git log看一下 就會看到你的commit了
|
git
mergetool
|
選用merge
tool後,會用merge tool merge。
完成關掉tool就算完成merge |
git am
--resolved
git am
--abort
git am -3
--abort
|
這個就是跟git說,你的merge已經完成了。
他就會commit了。 git log就會看到你的commit了。
如果你merge完後,覺得還是有問題, 不要了,
有沒有加上-3的選項都可以, 通常有加的話git會聰明一點你就git am --abort就會還原了。 |
git
status
|
在修改過的file的.git目錄下這個command,
檢視自已修改了哪些檔案
|
git
log
|
秀出commit
history, 在.git目錄內看別人曾改過的紀錄
按/
可以輸入要搜尋的人名, 按enter, /, enter, /這樣的方式去搜尋下一筆
|
git add
|
把尚未增加到server的file給加上去
|
git reset
--hard [commit number]
git reset [commit
number]
|
回復到以前某一個版本的commit,回到前一個commit的狀態,改過的那個會不見
回到前一個commit,但是改過的還在
|
git diff
[path/file name]
|
列出某個檔案的diff
|
git rm [path/file
name]
|
從Staging
Area 移除檔案
|
git commit
-m
|
|
git format-patch
-1
|
做一個patch,依據command最後的那個數字,來決定做幾個patch
做patch,
數字多少就會做幾個patch, 這是根據commit來產生的, patch的編號是從舊到新來編的
|
git pull korg
|
同步SERVER上的此資料夾
|
git push
origin HEAD:refs/for/master
|
上auto
test的code
|
git show
|
show出這個commit所修改的內容,也就是如果做成patch檔所顯示的內容
|
./repo forall -c "pwd; git status" | 查看每個git的status |
git branch -ra
|
列出所有branch,
不能打git branch -ar
|
git config
|
用來修改一開始下載code的時候下git init時所填的bugzilla會用到的資料
git init所填寫的info關係到各位之後進code時的一些資料,
有些人可能一時誤打,在緊急時刻也沒有時間重新抓一份code來做事。
所以,現在教各位修改相關的info.
我們repo init下來的code是有非常多的”git project”組成,ex,
kernel就是一個git project., 你可以用
vim .git/config
來修改你當下git project的info
[user]
name = ping_chen
email = ping_chen@xxx.com
[bugzilla]
project = PenguinCAP
loginname = ping_chen@xxx.com
password = xxxxxx
而,另一種比較正規的方式是
git config --replace-all user.name testID
git config --replace-all user.email testEmail@xxx.com
git config --replace-all bugzilla.project testProjectName (PenguinCAP)
git config --replace-all
bugzilla.loginame testEmail@xxx.com
git cofig --replace-all bugzilla.password testPassword
你就可以把你要的值改掉了
如果你要對整個Android
source code的git project都更改,請在source
code 根目錄下加上 ./repo forall -c
|
error: android/: prior sync failed; rebase still in progress
|
出現這種錯誤訊息的時候,不能repo sync
輸入
git rebase --abort
git am -3 --abort
再./repo sync就可以
|
ssh-keygen -t rsa
|
首先進到.ssh這麼目錄下
Generating public/private rsa key pair.
Enter file in which to save the key (/home/brandon/.ssh/id_rsa): 輸入你要放key的目錄
Created directory '/home/brandon/.ssh'.
Enter passphrase (empty for no passphrase): 直接按Enter就好
Enter same passphrase again: 直接按Enter就好
Your identification has been saved in /home/brandon/.ssh/id_rsa.
Your public key has been saved in /home/brandon/.ssh/id_rsa.pub.
...
...
~/.ssh/id_rsa
Private key, 每個帳號的private key都不同
~/.ssh/id_rsa.pub
Public key, 每個public key 對應一個private key
右上角Settings\
左邊列My/SSH Public Keys
複製裡面的東西$ cat ~/.ssh/id_rsa.pub 到網頁上
再按add
|
2013年12月9日 星期一
[Linux]常用的Linux command
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言