Common conflict

scenario

Sometimes a commit will be rejected for a remote repository paUSH, but there is a universal solution.

one

Git log finds a version that is sure to have no exceptions

two

Git reset –soft Rollback of the version number. The workspace code is retained, and the staging area is rolled back to the current version

three

Git Stash saves changes to your workspace and clears your workspace

four

Git pull — Rebase updates code and automatically merges it

five

Git Stash Pop Restores the code saved before the workspace

six

Git status Checks the status of the code and resolves conflicting files

seven

Git commit -m “” and then push is fine

Common commands

git reflog

The git reflog command is different from the git log command in that git log only shows the commit number. Git reflog shows you the version number of each operation. Git reflog shows you every commit, pull, push, reset, and so on.

Git Stash and Git Stash Pop

The Git Stash stash stash stash stash saves your changes in your workspace, that is, when you change your code and you haven’t added it yet, so your workspace will look unchanged. Git Stash Pop displays the code you saved while you were git Stash in your workspace. It works very well.

git commit –amend

This command is also useful when you need to fix an error after the commit and don’t want another commit. This command changes your last commit to the current one. Enter enter will enter the Vim editor, edit remarks (this is really difficult to use the editor). Press I to enter editing mode. Press :wq and press Enter to save and exit. Note: q! Abandon Modify forcibly exit.

Just write it down at work, and I’ll give you some examples later. To be continued…