Very early registration of GitHub, has not been how to use, today took a bit of time to toss, after all, after their own code can have a place to store. When you see the results of your work can hang on the internet, or a small sense of accomplishment.
For this little accomplishment, I started my github trip.
This article is mainly aimed at Windows system, start content, online a lot, I directly learn from the predecessors of the summary, mainly for the use of the process encountered problems, do some instructions.
Introduction of http://blog.csdn.net/hcbbt/article/details/11651229
1. Register your account and create a warehouse (HelloWorld)
2. Installing the client Msysgit
After loading the msysgit right mouse will have some more options, in the local repository right-click Git Init here, will be more than a. git folder, which means that the local git created successfully. Right-click Git bash to go to the GIT command line and configure SSH key to upload the local repository to GitHub.
3. Configure Git
Ssh-keygen-t rsa-c "[Email protected]"
behind the[email protected]change to your mailbox, then ask to confirm the path and enter the password, we use the default one-way return to the line. Successful words will be generated under ~/. SSH folder, go in, open id_rsa.pub, copy the key inside.
Note: If you are prompted with an error Could not create directory '//.ssh ', you need to set the environment variable "Home"---> "Your home directory", I am here to set the home----->c:\users\ Administrator. Otherwise in the subsequent ssh-t [email protected] will be wrong
The Id_rsa.pub file is generated at the same time under the. SSH target of the current path. Description Key has been generated
4. Add the key you just generated to GitHub
Click on the GitHub site account Setting > SSH keys >add ssh key, not clear can see
In order to verify success, enter it under Git bash
ssh-t [email protected]
if it is the first time will prompt whether continue, enter Yes will see: You ' ve successfully authenticated, but GitHub does not provide shell access. This means that you have successfully connected to GitHub.
5, The local warehouse to GitHub, before you need to set up username and email, Because GitHub will record them every time a commit.
Let's say I created a HelloWorld repository on GitHub.
git remote add origin [email protected]:yourname/helloworld.git
The following yourname and Yourrepo indicate that you re-github user name and the newly created warehouse, added after the addition of the. git, open config, here will be a remote "origin" content, this is just added to the long-range address, You can also modify config directly to configure the remote address.
6, submit local code to GitHub remote repository
Next, add some files to the local repository, such as the readme, or upload a css,js folder.
git add README git commit-m "first commit" git add css git commit-m "css" git add js git commint-m "JS"
Submit
the git push command pushes the local repository to the remote server.
the git pull command is the opposite.
When you're done, you can login to GitHub, see the Hellowork repository, and more CSS and JS folders
The first GitHub experience