The Git tool was installed very early and didn't have a GitHub account before, and now you're registering for one and want to learn about hosting your own projects and code.
After logging in to your GitHub account, click the green "New repository" to enter a name and comment.
Open the Git tool and use the CD command to enter the directory where the project is located, such as my count project in the D/myeclipse/spring directory, so:
CD D:
CD Myeclipse/srping/count
At this point, navigate to the Count project.
Touch readme.md//new readme.md file git init//generate local git management in the current project directory and create a hidden. Git directory git Add. Add all the files in the current directory to the index git commit-m "first commit"//submit to the local source repository and attach the commit comment git remote add Origin https://github.com/chape/test.git Add to remote project, alias Origingit push-u Origin master//push local repository to GitHub alias to Origin remote project, confirm commit
Enter GitHub's account number and password after push.
I got an error after the first push:
After the query found that my project count has a readme.md file, the content is empty, and GitHub also has a readme.md, there is content, two readme.md files are not the same.
On the Internet, the readme.md file on GitHub does not exist in the local project, see: http://jingyan.baidu.com/article/f3e34a12a25bc8f5ea65354a.html?st=2 &net_type=&bd_page_type=1&os=0&rst=&[email protected]
Code merge with command git pull--rebase Origin master
Then look at the readme.md in the project, with the same content as on GitHub.
Re-commit Git push-u Origin master to submit the project.
Enter the user name and password for GitHub.
From writing objects: The push rate can be seen. A certain amount of time is required.
It's nice to see the last push-completed project on GitHub.
Recommended study Materials: http://my.oschina.net/u/855386/blog/353615
The first experience of GitHub uploading projects