Home  >  Article  >  Web Front-end  >  git bash upload code to github

git bash upload code to github

PHP中文网
PHP中文网Original
2017-07-14 18:09:472080browse

Today, my notebook started to freeze, so I decided to reinstall the system.

By the way, review the use of git local commands

1, configuration

2 Skip the general operations first. Introducing the operation of linking to github remote library

My two keys are in the C:\Users\bond\.ssh folder. Open id_rsa.pub and copy all the contents inside. Then go to the ssh key setting page of github to add key.

Two points to understand: First, GitHub requires an ssh key to identify whether the submitted content is your own operation.

Second point: Github allows you to add multiple Keys. Suppose you have several computers, and you submit them at the company and at home. As long as you add the key of each computer to GitHub, you can push it to GitHub on each computer.

3. Clone/upload from remote library to remote library

Clone is relatively simple, just one line of code is ok

$ git clone git@github.com:hewasdrunk/test3.git

Updating the upload code requires a little more basic operations. I just took the jpg I made some time ago.

There are other commands: as follows

git log View the contents of each modified version

git status Check whether you submitted the request

git diff test1.html View modified content

Generally speaking, as long as git knows and uses the information I listed, it is already qualified.

The above is the detailed content of git bash upload code to github. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Introduction to CSSNext article:Introduction to CSS