[git related] install and configure git and github under windows

1. Download the Git client

Git client download address: https://git-scm.com/downloads
Windows git client https://git-scm.com/download/win
Copy the address to the browser bar to download.

2. Install the Git client and
choose the installation component : you can also choose it by default;
Addition icons : choose whether to create a quick launch bar icon or whether to create a desktop shortcut;
desktop browsing (Windows Explorer integration) : the method of browsing the source code, separately Use only bash or Git GUI tools for contextual browsing; use git-cheetah plugin for advanced contextual browsing;
associated configuration files : whether to associate git configuration files, which mainly display the style of text editors;
associated shell script files : Whether to associate the script file executed by the Bash command line;
use TrueType encoding : whether to use the TruthType encoding in the command line, which is a common encoding developed by Microsoft and Apple;
write picture description here
write picture description here


Set environment variables: choose what kind of command line tool to use. In general, we can use Git Bash by default, which is selected by default;
– Git comes with: Use Git Bash command line tool that comes with Git;
– The system comes with CMD : use Command-line tools for Windows systems;
– Both : The above two are configured at the same time, but note that this will overwrite the find.exe and sort.exe tools in Windows, if you do not understand these, try not to choose;
write picture description here


write picture description here

Select the newline format :
– Check out the windows format and convert it to unix format : Convert the newline in windows format to the newline in unix format before submitting;
– Check out the original format and convert it to unix format : no matter what format, it will be converted to unix format Newline is submitting;
– no format conversion : no conversion, what is checked, submit what;
write picture description here

The other way is next.


3. Configure GitHub

Start GIt Bash
write picture description here
(1) Create local ssh

Use command: create local ssh

ssh-keygen -t rsa -C "github注册的邮箱@163.com"  

GitHub mailbox: The mailbox after this command is the registered mailbox of GitHub.
Path selection: After using this command, a prompt will appear to select the ssh-key generation path. Here, just click Enter to default, and the generated ssh-key is in the default path;
Password confirmation: here we do not use a password to log in, it is too troublesome to use a password;

Just press Enter, and the instruction to generate ok appears
write picture description here

write picture description here

(2) Configure ssh to GitHub
Enter the generated ssh directory: C:\Documents and Settings\Administrator.ssh, use Notepad to open the id_rsa.pub file; the
content of the id_rsa.pub file:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDX9gvbku9IWNjwQ1BUg42I9kFbCy8nc67oemaQfg1GawCSRrWVDTHrZMiHxiQN1i9xE+hKOdembVofFJw9wLAkHrQ2hRaoI7mElLfHz3OUVpAvtxolVZ/Tev6bgABt+fmN4bOAx7t50QYDENodHfgQLg8nk71h4ZCeer5mF+/qWfCU5QarMP8m8V5WRZw89E3m0pCnDc+2n4I5XPbYNJKK8gqo8C/CzR3PkjVOfeHXXFF0/6thOoDBE9gZNvii32CI2WV6LpDpcq857HwfcmeQesii9bObLSTn0J2GI739go7pszYbpu6bDHGpr9H+XmKuPQGuMyohKhbWcwe7wRfh XXXXXXXXXXXXXXXXXXXXXX@hotmail.com

Enter the GitHub website:
log in to GitHub, select Account Setting user settings:
write picture description here


Give a name, copy the contents of the id_rsa.pub file, Add SSH key
write picture description here

Verify that the configuration is successful:
use the command:

ssh -T git@github.com  

write picture description here

(3) Configure local users and mailboxes
User name and mailbox function: We need to set a user name and mailbox, which is used to upload the local warehouse to GitHub, and display the code uploader in GitHub;
use the command:

git config --global user.name "HanShuliang" //设置用户名  
git config --global user.email "[email protected]"  //设置邮箱  
git config --global user.name "leolin0518" 
git config --global user.email "[email protected]" 

4. Git Bash submit source code to GitHub

(1) Create a project in GitHub
write picture description here

write picture description here

The https address of the project: https://github.com/leolin0518/openssl_dec_enc_tool
The SSH address of the project: [email protected]:leolin0518/openssl_dec_enc_tool.git

How to view the project address is as follows:
write picture description here


Clone the github created

git clone git@github.com:leolin0518/openssl_dec_enc_tool.git

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325883178&siteId=291194637