About Git
Linus's second great work. 2005 because BitKeeper software company discontinued free access to the Linux community. Linus had to develop a distributed version control tool, so Git was born.
Currently using Git as a version-controlled open source software: Linux kernel,android, JQuery, Ruby on Rails,debian ...
The number of projects using Git on eclipse has exceeded the number of repositories using SVN.
How to install Git on Windows
You can download git from the website or online, here I share the git-1.9.4-preview20140815: Http://pan.baidu.com/s/1sj3dihB
After downloading, double-click to install
Specific installation method reference: http://jingyan.baidu.com/article/bea41d4373e9bdb4c41be669.html
After the installation is complete, find "git-to-git Bash" in the Start menu, as follows:
Git evaluates the reasons for falling in love with Git
- Distributed, off-line operation
- Daily work Backup
- Cooperative work in different places
- Field version control
- Avoid introducing secondary catalogs
- Can somehow
- Work progress is kept at any time
- Fast
- 。。。。。
Reasons to Hate Git
- A complex information model
- Crazy command syntax
- A confusing document
- New concept Flooding
- Poor confidentiality
- Long Learning Cycle
- 。。。。。。
Centralized collaboration model
Social network-based collaboration model
GIT Usage Scenarios
Start git operation
New directory E:\WorkSpace\repository\git in E-drive
After you have git installed on your computer, right-click in this directory
Will find that this is a Linux-based way to display our current directory
1, the warehouse initialization, here I actually is the analog code server above the shared warehouse
--Create a new--bare: Empty warehouse warehouse name Shared.git
Git init--bare shared.git
Warehouse file Directory
HEAD: A commit that points to the current branch
Description: Description information for the project
Config: Configuration information for the project
info/: There is a exclude file that specifies the files to ignore for this project
Objects/:git Object Library (Commit,tree,blob,tag)
refs/: Identifies which commit each of your branches points to
hooks/: Default Hook Script
2, in order to simulate the local developers, on the computer to establish two folder User1,user2, representing two different developer local working directory
3, simulated User1 clone Central Warehouse
Git basic commands
============== Version Administrator Operation ========================First step: Create a data warehouse git init--Bare shared.git============== Developer 1 Operation =============================Second step: Copy repository to local git clone/e/workspace/repository/git/shared.git/ . (Note that there is a point that indicates the current directory) step three: Set personal information gitConfigUser.Name"User1"gitConfigUser.email"[email protected]"Fourth Step: Ignore document without version control echo"*.txt">. Gitignore Fifth Step: Create a new file echo"User1 Add Content">index.aspx
Sixth step: Commit file git add index.jspgit commit-M"User1 Add the file"Seventh Step: Submit your own repository to the public server Git push Origin master============== Developer 2 Operation =============================Eighth step: Copy repository to local git clone/e/workspace/repository/git/shared.git/. Nineth Step: Set personal information gitConfigUser.Name"User2"gitConfigUser.email"[email protected]"Tenth step: Ignore document without version control echo"*.txt">. Gitignore 11th Step: Create a new file echo"User2 Add Content">>index.aspx 12th step: Commit file git add index.jspgit commit-M"User2 Add the file!"13th step: Submit your own repository to the public server Git push Origin master============== Developer 1 Operation =============================14th step: Download the latest server data git pull
Tortoisegit
If you feel that such commands are cumbersome to operate, accustomed to the past TORTOISSVN turtle shell such a visual client tool, then you can also download the Git Visual client tool, My computer is 64bit, so this is only available 64bit download.
Tortoisegit_1.8.9.0_x64:http://pan.baidu.com/s/1ntdujml
I will explain the use of tortoisegit in the next article.
Git get started one