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

沒有留言: