a beginner's approach to uploading files to GitHubCategory: GitHub2013-08-30 00:49 11821 People read Comments (3) favorite reports
Ashamed to say, I was recently started with GitHub, a little white one, yesterday studied an afternoon. Finally can upload, so today write points, one share is some of their own experience, and second is to make a record, in case one day and do not remember:)
Needless to say, come directly, this time the main introduction is the installation and use of Windows.
"First step" set up first warehouse
The first step of the words to see the general hint will know, in GitHub new repository (Google can solve), are visual interface operation, so difficult. Or look here: Https://help.github.com/articles/create-a-repo This is the official help, although it is in English, but basically is a graph and code, so it is easy to read.
In the top right corner of the GitHub home page, click Create New Repo in the red box.
Access to the new warehouse interface
Fill in the warehouse name, Initialize this repository with a readme is optional, but I suggest the best choice, you can save a step in the back. After filling it out, click Create Repository.
"Second Step" clone warehouse
The second step starts with the basic command-line mode, but first download the command-line tool from GitHub. : http://windows.github.com/
Then after a simple installation, two icons are created on the desktop, GitHub and git shell,github are graphical, git shell is command-line mode, and the default Git repository is built on the C-drive, and the individual suggests that the path be reset.
Open the Git Shell and go to the command line. First we'll clone our new repository on GitHub, and for the demo, I've created a new git called Myrepoforblog on GitHub.
Before initializing the repository, verify that the Certified public key is correct, as follows:
ssh-t [email protected]
The correct results are as follows:
warning:permanently added ' github.com,207.97.227.239 ' (RSA) to the list of known hosts. Hi findingsea! You've successfully authenticated, but GitHub does not provide shell access.
There will be a warning, don't bother.
Then clone the library, as follows:
git clone https://github.com/findingsea/myRepoForBlog.git
The above address can be found in the following interface:
Clone succeeded as follows:
Cloning into ' myrepoforblog ' ... warning:permanently added ' github.com,207.97.227.239 ' (RSA) to the list of known hosts. Remote:counting Objects:3, done. Remote:total 3 (Delta 0), reused 0 (Delta 0) receiving objects:100% (3/3), done.
"Step three" upload readme.md file
At this time, our GitHub folder has a Myrepoforblog folder, go to the folder directory, to initialize the warehouse, if we have not checked the creation of the Readme, you must first create the readme.md file, or upload the file will be error. If you have checked the first step, you can go directly to the fourth step.
Git init touch readme.md git add readme.md git commit-m ' first_commit ' git remote add Origin Https://github.com/findi Ngsea/myrepoforblog.git git push Origin master
"Fourth Step" push file
Once the readme.md is created, it is ready to push and the code is similar.
git Add. Git commit-m ' first_commit ' git remote add origin https://github.com/findingsea/myRepoForBlog.git git push Origin maste R
If you execute git remote add Origin https://github.com/findingsea/myRepoForBlog.git, an error occurs:
Fatal:remote origin already exists
The following statement is executed:
Git remote RM origin
Then execute git remote add Origin https://github.com/findingsea/myRepoForBlog.git.
When executing GIT push Origin master, an error occurred:
error:failed to-push som refs to ....
The following statement is executed:
Git pull Origin Master
First, the remote server github above the file pulled first, and then push up.
End
Again to emphasize this article is mainly for beginners, also on my this kind of GitHub rookie.
Finally, thank those bloggers who have been selfless in sharing their experience and knowledge.
"Reprint" about how beginners upload files to GitHub