Git error: 解決在Gerrit網頁上submit patch set 出現衝突的情況

Cause:
在Gerrit等待code review通過期間,若有協同開發者先merge commit,且該commit和自己的commit
發生衝突的情況

Solution:

1.
在發生conflict branch上 執行
git pull --rebase origin master
此指令說明如下
This command will fetch new commits from the remote and then rebase your local commits on top of them. It will temporarily set aside the changes you've made in your branch, apply all of the changes that have happend in master to your working branch, then merge (recommit) all of the changes you've made back into the branch. Doing this will help avoid future merge conflicts. Plus, it gives you an opportunity to test your changes against the latest code in master.
Once you are satisfied with your change set and you've rebased against master, you are ready to push your code to Gerrit for review.

簡單的說:把master上已合併的commit(但在目前branch不存在),接到目前的branch,再把
目前branchcommit接到最後面(最新)
當然在Gerrit網頁上合併會發生衝突,所以執行這個指令之後在本地端也會發生衝突,把執行後的提示紀錄下來如下

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase –abort".
第一行為當修改衝突後,要執行的指令

2.修改發生衝突的地方,使用vim修改
3.把修改後的檔案全部 git add
4.git add 所有的檔案之後執行 git rebase --continue
5.最後 git push origin HEAD:refs/for/master

6.必須重新等待code review

Eclipse Error: Indexer runs out of memory

Cause:
編譯jni會產生大量的檔案,特別是 C/C++ indexer 會建立索引 若eclipse初始記憶體太小會導致
out of memory 的錯誤

Solution:
在 eclipse.ini檔案中可設定記憶體限制,主要調整以下幾個數值

初始設定
--launcher.XXMaxPermSize
256m
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m

調整後
--launcher.XXMaxPermSize
512m
-XX:MaxPermSize=512m
-Xms80m
-Xmx1000m



細節參考
http://wiki.eclipse.org/Eclipse.ini

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews