2011年4月20日 星期三

Git Basic Manipulation

Assume here is a project name A and stores at directory C:\A.
We try to use Git to control the project source files.

We can execute Git Bash for operation.







Go to directory A then initial Git management.


Create a new file Hello.txt and input hello in file content.















Notify Git we have a new file in directory need to be managed.
git add .  mean add all file in directory.
git add <fileName> to add single file




Commit all changed in past operation.
git commit -am 'initial' 
    -a mean commit all changed files
    -m 'initial' mean plus commit memo.

Now, Assume someone B want to help develop project A at directory C:\B
B need to get project A's files.

B modify the Hello.txt content to 'hello by B'.

B commits his changed file.

Then B tell A that B has done his job, A can merge the changed file now.
A get file from B.

A compare the differenct between source file and new file.

A merge new file into source file.

Hello.txt of A has chenged
















If A modify again.






B can pull new version from A.




















Reference :

沒有留言:

張貼留言