- Git init – Create a new code base in the current directory.
- Git config user.name= “” git config user.email=” “
- Git Clone requires the remote address to clone the project from the server to the local location
- Git status – Check file modification status.
- Git diff file path – See how this file differs from the last time you committed your changes.
- Git diff — -cached file path — see the difference between the local buffer and the last commit.
- Git Checkout — b branch name — Create a temporary branch.
- Git Checkout branch name — Switch branches
- Git branch – View all branches.
- Git branch -d temp – Deletes a branch forcibly
- Git pull – Updates server-side code locally.
- Git add File path – Commit the file to the rush zone.
- Git add -a – Commit all files that need to be added to the buffer.
- Git commit — m ‘commit instructions’ — commit the files of the buffer to the local library. The submission instructions should be as simple and clear as possible.
- Git push Origin Master – Pushes code that has already been committed to a local repository to a remote server.
- Git log – Displays committed logs.
- Git show [commit Id] – displays metadata and content changes for a commit.
- Git show [commit Id] — -stat — Displays the name of the committed file
- Git Checkout – Restore all files in the staging area.
- Git reset [file/commit ID] – Resets a specified file in the staging area. Used to revoke git commit
- Git reset — hard [commit Id] — resets the local version to the version before the commit. This operation will undo all of the newly written code.
- Git cherry-pick temp — merge temporary branches into current branches.
- Git commit — amend — Modify the last commit description and merge the commit. Invalid for pushed.
- Git rm < path of files in the local repository to be deleted (if the directory has been committed to the remote repository) > git commit -m Run the delete file command to delete files from the remote repository