2013年9月18日水曜日

Yet another GIT tutorial under 5 minutes.

At your command prompt, type "git", Nothing happens? Please Google "How to install GIT" and come back.

Just keep typing the following and observe what happens. (This procedure is based on this blog).

Start at any junk directory/folder such as temp.

Start!


$ mkdir gittest


cd gittest


mkdir example.git


cd example.git


git init --bare


cd ..


git clone example.git example1


cd example1


$ emacs test.txt (use Notepad on Windows)


Type "hello" in test.txt, and then save and close notepad.


git add test.txt


git status 


git commit -a -m "new file added."


git status


git push origin master


cd ..


git clone example.git example2


cd example2


git log


emacs test.txt


Type "I am using GIT!" in test.txt, and then save and close notepad.


git status


git commit -a -m "added another line."


git status


git push origin master


cd ../example1


git log


git pull


git log


Done!


You have just simulated a typical coding cycles using any version control system.
  1. Created a new repository for the team
  2. A team member added a new source file (initial implementation)
  3. Another team member modified the file (bug fix)
  4. The first team member received the fix made by his buddy.

0 件のコメント:

コメントを投稿