Get the App
SLTechnology News&Howtos  ›  Development  › 

What commands need to be memorized in Git?

Shulou Source: shulou.com Published: 2022-06-03 12:58:20 10月02日 Update

This article mainly shows you "which commands need to be memorized in Git". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn what commands need to be memorized in Git.

Related to the submission process

View file changes and new files

Git status

Add new files

Git add your_file_path / / add all files git add * / / add a certain type of file git add dir/*.js

A simple submission

Git commit-m "Commit message"

Submit all your modifications and additions

Git commit-am 'your message'

Undo and modify a file

Git checkout--

Discard all local changes

Git fetch origin git reset-hard origin/master

Update related

Update remote code

Git pull

Show merge conflict files

Git diff

View a merge conflict file

Git diff-base

Add a post-conflict resolution file

Git add

Submit your changes to the trunk

Git push origin master

Branch correlation

Create a new branch and cut to it

Git checkout-b your_branch_name

Switch branch

Git checkout your_branch_name

View the branch and the list of branches

Git branch

Submit to a branch

Git push origin your_branch_name

Contrast branching difference

Git diff

Merge a branch into your current branch

Git merge your_branch_name

Delete a branch of a remote warehouse

Git push origin: your_branch_name

Delete a branch

Git branch-d your_branch_name

Label and project initialization

Git init initialization project name git tag 0.9.1

Configuration

Configure your user name and mailbox

Git config-- global user.name "Jack" git config-- global user.email jack@gmail.com is all the contents of this article "what are the commands to remember in Git?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Branch file command content article conflict location project learning help update configuration trunk warehouse code name difference easy to understand more organized Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Redmi MySQL Docker Shulou Information