2012年1月30日 星期一

Add GIT HUB public key

Generate GIT-HUB ssh key and try to handshaking
1. Log on to GIT HUB with google account
2. Set username and email ( if not default google account )
3. generate a RSA key by
ssh-keygen -t rsa -C "chenhj1234@gmail.com"
then
cat ~/.ssh/id_rsa.pub
===================================================================
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+K1lUFipFIHV/Pi44CzFEDUitb2c3KPm4dyC3wF3qpCNRAMJ18Ay8GrrPye1i4v/9oDIxnARdBKLFLWXO5dMcGU0A0vbo8MGRNEbLJXizD0z7yox/qT5+jVkYqEaBK0Lkt0g6z2Um0tkN1r/sO0vPfj93Pq1D4rdVPJdXA1jUxkJUJtqMbFE5wikym2hgrk9jd4Wm4ffx+tAMCc+hmLhs9/zfIPeYpGmkA7gY70IzJI7bWc3S8qeV0EiyIWU1WfdMk0ArnQzWh8FX4Wc2XMn3WsqK8EiKn76Qq0nuJ6djLPrX+ezXKnGGV64fvwx1cYJ1nl74BTmHm5pis+qqcXON chenhj1234@gmail.com
===================================================================
4. Put the key content onto GIT HUB server
5. Issue "ssh-add" command
6. Test by ssh -p git-server-port username@your-git-server.com

2012年1月4日 星期三

Some confusing points in GIT

Command to check the local and remote branches
git branch # see local branches
git branch -r # see remote branches

GIT is a multiple tree distributed version control system. All developer working on their local copies of version tree.

---------------------------------------------- remote

-----
/
-------------- local1
\
----------

-----
/
-------------- local2
\
----------

-----
/
-------------- local3
\
----------

To resolve the complex metric, we get 2 sets of commands

1. checkout/add/commit/rebase, working on local tree management
2. clone/fetch/merge/pull/push, working on remote tree conversation

To reserve the complex tree structure, we have folders and files
For local branches :
.git/refs/heads/master
local_branch_1
local_branch_2
local_branch_3
For remote repositories :
.git/refs/remotes/origin/master
local_branch_1
local_branch_2
local_branch_3
When we mention about a "remote repository", it means a "remotes/XXX" folder.
Basically, origin is a must-have repository.

When we mention about a refspec or a remote branch or a named commits, it means a "remotes/XXX/YYY" file.
Basically, origin/master is a must-have repository.

When we mention about a commit, it means ???

Details :
Looking at the manpage of git-fetch
- git fetch [] [ [...]]
Since its parameter is , it uses (with an hidden refs/remotes)
- git fetch origin

Looking at the manpage of git-merge
- git merge [-n] [--stat] [--no-commit] [--squash]
[-s ] [-X ]
[--[no-]rerere-autoupdate] [-m ] ...
- git merge HEAD ...

Since its parameter is , it uses (with an hidden refs/remotes)
- git merge origin/master