After the 1.git installation, find Git Bash in the Start menu, something like a command-line window, the initial setup msysgit, simple two commands to do:
git config--global user.name "XXX"
git config--global user.email "XXXXX"
2. To upload a local file to GitHub, you need to create an SSH key locally:
Ssh-keygen-t rsa-c "[Email protected]"
You will then be asked to confirm the path and enter the password, here we go by default. The. SSH folder will be generated in your user directory, then go in, open id_rsa.pub, and copy the key inside.
Go back to GitHub, go to Settings, choose SSH and GPG Keys on the left, click Add SSH keys,title to fill in, paste key.
3. In order to verify that the connection is successful, enter it under GIT bash:
ssh-t [email protected]
If this is the first time you will be prompted whether to continue, enter Yes, and so on, you will see:
Hi xxxxx! You've successfully authenticated, but GitHub doesnot provide shell access.
This means that you have successfully connected to GitHub.
4. Submit your Code
Once you have done this, you can submit your own local code. Locate the local code folder you want to submit, right-click to select Git Bash and build a repository:
Git init
Select the files to add to the warehouse:
git Add.
If you want to share all the code in this folder, add "." After add, and if you specify a file, simply "." Change to a file name.
Add into Warehouse:
Git commit-m "First commit"
The parameter after-M, which indicates that the code is submitted to GitHub, will give a description of the submission, indicating which time I submitted it.
All work is ready, now to be submitted, or a few commands:
Git remote add Origin http://github.com/liyucang/project.git
Git pull Origin Master
Git push Origin Master
Above
Submitting items to GitHub under the Windows platform