Introduction to Git Use


To be continued

I. Basic concepts

Common orders

1. Quick Lookup Table of Common Commands

Introduction to Git Use

2. Quick Lookup Table of Common Commands (Chinese)

Introduction to Git Use

Scene Application

1. Configure Git account

Priority: Engineering Level > User Level > System Level

  • System-level configuration

    • System contains generic configurations for users and their warehouses that are not on the system
    • Located at / etc / gitconfig
  • User-level configuration

    • –Global only for current users
    • Located at ~/.git config or ~/.config/git/config
  • Engineering Level Configuration

    • Only for the current warehouse
    • Git/config in the current warehouse
  • View Git configuration

    git config
    git config
  • Add global configuration

    # Git global setup
    git config --global "example"
    git config --global "[email protected]"

2. Creating an initial warehouse

Scenario: The initial warehouse content is empty, and the file content needs to be added to the initial warehouse. Here are two ways to add:
1. Clone the empty warehouse, enter the corresponding folder to add files and upload files.
2. Existing project files to be uploaded are entered into the folder and uploaded as warehouse contents.

  • Flow chart
    Introduction to Git Use
  • Operational steps

    • Create new directories and files and upload them to the warehouse

      # Create a new repository
      git clone
      cd project
      git add
      git commit -m "add README"
      git push -u origin master
    • Existing directories and files are uploaded to the warehouse

      # Existing folder or Git repository
      cd existing_folder
      git init
      git remote add origin
      git add .
      git commit
      git push -u origin master

3. Get the version of the specified tag

Get the branch version of openwrt tag v18.06.2

  • Tag version
    Introduction to Git Use
  • Git command

    git clone --branch v18.06.2

IV. References

Recommended Today

Build HTTP service with C + + Mongoose

Mongoose source code address:… Mongoose user manual:… Mngoose set up HTTP service #include <string> #include “mongoose.h” using namespace std; static const char *s_http_port = “8000”; static void ev_handler(mg_connection *nc, int ev, void *ev_data) { struct http_message *hm = (struct http_message *) ev_data; if (ev == MG_EV_HTTP_REQUEST) { std::string uri; if (hm->uri.p && hm->uri.p[0] == ‘/’) […]