1. Configure identity
$ git config--global user.name "AAA"
$ git config--global user.email "[Email protected]"
To see if the configuration was successful
$ git config--global user.name
$ git config--global user.email
2. Using Git to build a code warehouse
(1)$ cd E //Enter the disk where the local file is stored, e disk here
$ cd Java/uilayouttest //Enter the folder where the local files are stored
(2) Create a warehouse
$ git init //will generate a hidden. Git folder at the root of the project, which is used to record all git operations on the ground, available $ ls-al view
(3) Add local code to library
$ git Add. //. Indicates that all files are added
(4) Submit
$ git commit-m "first commit"
3. Generate SSH Key
(1) Check if SSH key is generated (usually installed by default)
$ ssh
(2) Specify the RSA algorithm to generate the key
$ ssh-keygen-t RSA after three consecutive returns, Id_rsa.pub found in/c/documents and settings/username/.ssh (hidden file)
(3) Add SSH key to GitHub
Set--ssh and GPG keys--new SSH key--Paste the contents of Id_rsa in key
(4) test whether the link is successful
$ ssh-t [email protected] //hint hi defnngj you ' ve successfully authenticated, but GitHub does not provide shell access . It means you're connected.
4. Uploading items to GitHub
(1) Create a new project on GitHub
(2) Associating a local project with a project on GitHub
$ git Remote add origin [email protected]:sunying225/uilayouttest.git
(3) Ensure that both ends of code are synchronized
$ git Pull--rebase Origin master
(4) Upload code
$ Git push-u Origin Master
Uploading local files to GitHub