Tag: Windows version used
Github installation
* download git
2. Configure Github
What do we do before we clone the library? We first have to generate the public key and then copy it to GitHub so we can log in without a password.
1. Create an SSH key locally
Git bash command line tool (Window start menu)
$ ssh-keygen -t rsa -C "[email protected]"
Copy the code
The key type can be specified with the -t option. If this parameter is not specified, the RSA key for SSH-2 is generated by default. Rsa is used here.
At the same time, there is a comment field in the key. You can use -c to specify a comment to identify the key and point out the purpose of the key or other useful information. So type in your email or whatever.
After the input, the program also requires the input of a secret language string (passphrase), empty indicates that there is no secret language. It then asks you to enter the password twice, leaving it blank to indicate there is no password. 3 press Enter to complete the current step, at this time, the [C > User > own user name >.ssh] directory has been generated, open id_rsa.pub, copy the key in the directory.
2. Create an SSH key on Github
Log on to making. Open setting->SSH keys, click New SSH key in the upper right corner, put the generated public key ID_rsa. pub into the key input box, and create a title for the current key to distinguish each key.
All we need to do is upload the local repository to Github. Before that, we need to set username and email, because github records them every time we commit.
$ git config --global user.name "your name"
$ git config --global user.email "[email protected]"
Copy the code
Use Github
1. Create a version library
What is a version library? Git keeps track of all changes and deletions of files in a repository, so that they can be traced at any time in history or “restored” at some point in the future.
Git init = git init = git init = git init = git init
$ git init
Copy the code
Git repository: Git repository: Git repository: Git repository: Git repository: Git repository: Git Repository: Git Repository Git repository is destroyed.
Add the file to the repository
Use git add to add a file to your repository (such as a readme.txt file in your directory) :
$ git add readme.txt
Copy the code
Commit to the repository with git commit:
$ git commit -m "wrote a readme file"
[master (root-commit) eaadf4e] wrote a readme file
1 file changed, 2 insertions(+)
create mode 100644 readme.txt
Copy the code
Git commit -m: git commit -m: git commit -m: git commit
Add files to Git repository in two steps:
- Using the command
git add <file>
, note that it can be used repeatedly to add multiple files; - Using the command
git commit -m <message>
And complete.