2018年1月26日 星期五

Git - 常用指令 : git add, git commit, git push, git status, git log, git show

  • git add
    • 將選擇的檔案先加入到 staging area
      • git add test_file.c
      • git add ../../test_file.h
        • 說明 : 不一定只能加入同一層的檔案 

2018年1月24日 星期三

Git - error : Your local changes to the following files would be overwritten by merge

  • error message         
         ================================================================
          error: Your local changes to the following files would be overwritten by merge:
                     project/code.c
          Please, commit your changes or stash them before you can merge.
          Aborting
         ================================================================

  • explain
    • git pull 後如果出現上面的error 訊息,
      表示 local 端的 code.c 的跟 remote 端的程式有衝突,
      也就是說已經有人跟你一樣改到 code.c 的同一段程式,
      而且比你早把程式放到 server 上

2018年1月10日 星期三

Linux - 管理 patch 的工具 : quilt


  • 1. 使用 quilt 
    • 需要在其他開發者的 source code 增加程式碼 (例 : linux kernel, hostapd ...)
      因爲無法直接使用 git 的方式 push code,
      所以使用 patch 的方式增加需要修改的 code,
      而 quilt 就是管理和產生 patch 的工具
    • quilt 的操作跟 stack 一樣,
      quilt push -> 把一個 patch 的內容放到 source code
      quilt pop  -> 讓 source code 的內容回復還沒有上一個 patch 的狀態
  • 2. 安裝 quilt
    • sudo apt-get install quilt

2017年11月16日 星期四

Git - 常用指令 : git config, git clone, git branch, git checkout, git pull

    • git config
      • 設定基本資料
        • git config --global user.name "sky"
        • git config --global user.email "email@gmail.com"
      • 檢查設定
        • git config --list

    2017年10月20日 星期五

    C - Standard Predefined Macros


    C 語言有些預先定義的巨集 ( Standard Predefined Macros ) , 
    可以直接印出行數、檔案名稱、函數名稱 ...

    -

    例如 : 
    如果要用 printf 印出行數時 , 不需要特別針對每一行去寫每一行的行數 , 
    也不用因爲前面多了幾行程式 , 就要把後面 printf 要印出的行數全部重新寫

    -

    2017年10月12日 星期四

    [Linux] update time


    暫停VM, 重開後的時間會是暫停VM時的時間, 不會自動更新時間


    • 查看現在時間
      • kaiyuan@linux:~$ date
        四  8月 31 19:42:44 CST 2017

    [C] error : dereferencing pointer to incomplete type

    error message
    error: dereferencing pointer to incomplete type
    if ( ioctl ( drv->ioctl_sock, IEEE80211_IOCTL_GETCHANINFO, &iwr ) < 0 ) {
                   ^