This is the 23rd day of my participation in the August More Text Challenge

How to set up your own Git repository

Step 1: Initialize the local library

Git init command: git init effect: a **. Git folder will be added to the root directory **

Step 2: Set the signature

Form:

User name: Zaki Email address :*****@**.comCopy the code

Note: The signature does not have anything to do with the password used to log in to the remote library.

  1. Git config username zaiki_pro git config -global user.email [email protected] The information is saved in.git/config

  2. System User level: Git config — -global user.email zaiki git config — -global user.email ********@**.com The information is saved in/system disk/user directory /.gitconfig

Priority: The project level is greater than the user level, that is, the project level prevails. Neither of them is allowed

Other common Git commands

git status

View the status of the workspace staging area

  • When the file is empty

  • After creating a new file

  • Once you have committed the file to the staging area, use Git add

  • Once the files have been committed to the repository, use git commit

git add [file]

Commit the file to the staging repository

git coommit [file]

To submit a file to a local library, you can simply add -m ‘*****’ so that you don’t need to enter the Vim editor and enter the explanation directly

  • After submitting the comment text

git log

View version details

  • The git log - pretty = onelineOnly one line per version is displayed
  • git log --onelineOnly one line is displayed for each version, but only part of the hash is displayed
  • The git log - reflogEach version is displayed on a single line, showing even deleted versions, and showing the steps required to roll back to a version