1. Download the git Windows client
https://git-for-windows.github.io/
2. Configure GitHub
After installing the Windows client, enter the following command inside
First, create a localssh key;
$ ssh---"[email protected]"
Later, [email protected]
instead of the mailbox registered on GitHub, you will be asked to confirm the path and enter the password, and we'll use the default return line. Successful words will be generated in the ~/
next .ssh
folder, go in, open id_rsa.pub
, copy inside key
.
Go back to GitHub, go to account Settings, choose SSH keys,add ssh key,title on the left, and paste the Key generated on your computer.
In order to verify success, enter it under GIT bash:
-T [email protected]. COM
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.
The next thing we need to do is upload the local repository to GitHub, and then we'll have to set up username and email, because GitHub will record them each time it commits.
--Global user. "Your name"--global user. "[Email protected]"
example:
$ git config -- global User. "Xiaoliuzi" $ git config --global User. "[email protected]"
Create a GitHub folder and go to that folder
$mkdir GitHub
$CD GitHub
Perform a git initialization operation
$git Init
Go to the repository you want to upload, right-click Git Bash, add remote address:
$ git Remote add origin [email protected]. COM:yourName/yourrepo. Git
Such as:
$ git Remote add origin [email protected]:xiaoliuzi/gluttonoussnake.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.
will create a good repository on GitHub code, clone down, and modify
$ git clone https://github.com/xiaoliuzi/GluttonousSnake.git
After modifying a file
$git Add file_name.c
Start tracking
$git commit-m ' some comments '
Then commit the changes
$git Push Origin Master
Note, if it is Linux, you may need to add sudo.
3. Create a new warehouse
Create a new folder, open it, and then execute it git init
to create a new git repository.
Reference:
Git pro
Http://www.runoob.com/w3cnote/git-guide.html
GitHub Getting Started Tutorial