2012年4月11日 星期三

GIT Notes

1. When sync with remote repository,
your local branch "refs" may sometimes gets a message
"Your branch is behind ‘remote/xxx’ by 12 commits, and can be fast-forwarded."
This message means a remote branch xxx was newer than our own local xxx. This may be due to other's commit or our developing on other folder.

At this time, you can issue :
  git checkout xxx
  git merge remote/remote_repository/xxx
It will merge the remote commits to our local xxx branch.

2. When push back "branches", "commits" or "tags", it needs to issue;
  git push remote_repository local_branch

3. Usually we have a development procedure like this ----------------------------------------------- Remote repository tree
              | | merge/fetch/push
----------------------------------------------- Local tree with local commits and branches.

We develop on local tree, commit then sync with remote repository.

The standard procedure for merge onto remote tree would be
a. issue fetch from remote tree
  ie. git fetch git_remote_repository .
b. issue merge from remote tree with local branch
  ie. assume we are developing on local branch "Do_Bob_Job" .
    git merge git_remote_repository/Do_Bob_Job .
c. if there are conflicts and we fix it, then commit the fixings
  ie. git commit -a -m"Add_for_Bob_Job" .
d. doing merge again
e. push on remote repository
  ie. git push git_remote_repository.

This procedure should do regularly to reduce conflicts.


4. Generate GIT patch for specified index
  git format-patch index^..index -o output_patch_file_path
  Description : index^ means previous of the specified index

5. Delete/Revert commits and move HEAD reference

2012年4月9日 星期一

用 Huawei 3G Dongle E220 連遠傳 3G

1. 安裝 wvdial
2. 編輯 /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Phone = *99#
APN = internet
Password = test
Username = test
Stupid Mode = 1
Dial Command = ATDT
3. 自動連綫 ~~~ 有空再補上