There is already a project in the local area, need to put the project on GitHub, how to do?
Steps:
Installing git locally is a prerequisite for a GitHub account.
(1) First create an empty warehouse on GitHub and copy the link address. Use HTTPS, the address that ends with. Git.
(2) Initialize the local repository and submit content to local
To open the command line terminal first, then switch to the directory of the project you want to add to GitHub by using the CD command, and then execute the following command in turn, with the following commands and their meanings:
Touch README.MD--Create a description document
Git init--Initialize the local repository
git Add. --Add all the modified files under the current command, prepare commit commits, the command effect is equivalent to Git add-a
git commit-m ' submit instructions '--Submit the modified file to the local repository, e.g. git commit-m ' add readme.md documentation '
Git remote add origin repository address-remote warehouse address, which is the address of your own new warehouse.
Git push-u Origin master-creates an upload stream and pushes local code through this stream to the master branch in the repository that is aliased to Origin
Wait a while and you'll need to enter your password, which is your github login password. It takes a while to upload the first time.
At this point, local projects have been uploaded to GitHub. For subsequent changes to the code submission, only the following actions are required:
git Add. --Add all the modified code to prepare for submission
git commit-m ' submit description '--Submit the modified code to the local repository first
Git pull--if you're collaborating with multiple developers, get pulled first, take GitHub's latest code locally, and avoid conflicts
Git push-pushes the code to GitHub and pushes it to the master branch in the repository that is aliased to Origin by default.
Git usage under Linux-put existing projects on GitHub