Installation and use of Git (super detailed tutorial)

Install

Git's official download address: https://git-scm.com/download/win

I am using a 64-bit system of window10 here, so I chose 64-bit Git for Windows Portable

After the download is complete, click Install

1. Click Run (R)


2. Select the installation location


3. Wait for the installation


After the above steps are completed, you can start using git.

Open the installation path and click git-bash (of course, you can also send this application to the desktop shortcut for convenience)


*************************************************************************************************************

*************************************************************************************************************

use

Ready to work:

first step:

Since the transmission between the local Git repository and the GitHub repository is encrypted by SSH, you must let the github repository authenticate your SSH key. Before that, you must generate the SSH key.

Enter the following command in the Git console:

$ ssh-keygen -t rsa -C "[email protected]"

  The required input can be skipped directly by pressing Enter. After running the above command, Windows users can enter C:\Users\Administrator\.ssh to view the generated file


Step 2: Log in to your github, then visit: https://github.com/settings/ssh/new

After adding SSH Keys, the local Git establishes a connection with the remote Github

Then we start our Git usage:


1. First of all, in order to facilitate our version control, we need to set the corresponding user name and mailbox, the command is as follows:

           The global parameter indicates that all warehouses on this machine will use this configuration (of course, you can also use different usernames and mailboxes for a warehouse.

2. Go to the specified file directory and create a repository through the init command (note that a local repository corresponds to a repository on github, you can use git remote to view the current remote repository)

    First of all, it must be clear that all version control systems can only track changes in text files, such as txt files, web pages, all program codes, etc. Git is not included. The version control system can tell you every change, but the picture , Although the binary files of videos can also be managed by the version control system, they cannot track the changes of the files. They can only string together each change of the binary files, that is, know that the picture has changed from 1kb to 2kb, but what has been changed? , version control doesn't know either.

After completing the above steps, a Git environment is basically set up.

 
 
git add "filename" //Users add files
git add . //Can be used to add all files in the current directory
git commit -m "committed content" //commit version information
git push //This step is the real upload



Guess you like

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