First, download the project
Warehouse address, in local git clone https://github.com/chenzhongzhu/chenzz.git
Second, upload the project
Git has the corresponding version support in any system, and the main point of today's talk is how to install and use it on Windows. The specific steps are as follows:
Serial number |
Operation |
Describe |
1 |
Download windows git terminal resembles Shell tool http://msysgit.github.io/ |
2 |
Install git-1.9.2-preview20140411, double click to run repeat next OK. |
3 |
Once the installation is complete, you can enter the test |
Install and start
1, we need to create an identity ID:
git config--global user.name sanxian
git config--global user.email sanxian@126.com
2, select a set of characters in window to build a git warehouse directory
cd/d
mkdir myprojects
3, create your own project folder name and initialize the Git repository.
mkdir Demo
CD Demo
Git init
(a hidden. Git suffix file is generated when this step is completed)
4, start using Git to manage our project, and copy any items from eclipse or MyEclipse to the demo directory.
Add when a class git add Test.java
If you add the entire project in, execute git add directly. You can add all the content to Git's warehouse.
Finally execute git commit-m "comment content"
How to use Git to upload your own items into the GitHub.
GitHub is a git project hosting site that makes it easy to share your open source projects, and of course it's very useful, and interested friends can search for them or look at their website's introduction.
1, we need to register our account in https://github.com/.
2, a new project warehousing
3, generate the public key file in Git, the need to connect GitHub
Commands are as follows: Ssh-keygen-t rsa-c "your_email@youremail.com"
4, after the command is generated, you can find the public key file under the C:\Users\qindongliang\.ssh folder,
Then we need to create a new config file with no suffix name, and add the following to prevent the connection github from failing.
Host github.com
User git
Hostname ssh.github.com
preferredauthentications publickey
identityfile ~/ . Ssh/id_rsa
Port 443
Upon completion of the above, our. SSH directory looks like this:
5, then copy, id_rsa.pub inside the content, copy to GitHub SSH keys inside, easy to authenticate the communication through SSH.
6, after the success, we can on the Git terminal, test the connection, if all is OK, the connection can communicate, execute the command as follows:
Ssh–t git@github.com
7, and then inside Git, into our warehouse demo directory
To execute a command:
Git remote add Origin git@github.com:qindongliang/demo.git
Git push-u Origin Master
The above steps, if there is no problem, you can successfully uploaded to the github, scattered cents here the example of the following screenshot:
At this point, we have successfully used git to upload local projects to GitHub, you can start to try.