1. Git init – Create a new code base in the current directory.
  2. Git config user.name= “” git config user.email=” “
  3. Git Clone requires the remote address to clone the project from the server to the local location
  4. Git status – Check file modification status.
  5. Git diff file path – See how this file differs from the last time you committed your changes.
  6. Git diff — -cached file path — see the difference between the local buffer and the last commit.
  7. Git Checkout — b branch name — Create a temporary branch.
  8. Git Checkout branch name — Switch branches
  9. Git branch – View all branches.
  10. Git branch -d temp – Deletes a branch forcibly
  11. Git pull – Updates server-side code locally.
  12. Git add File path – Commit the file to the rush zone.
  13. Git add -a – Commit all files that need to be added to the buffer.
  14. 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.
  15. Git push Origin Master – Pushes code that has already been committed to a local repository to a remote server.
  16. Git log – Displays committed logs.
  17. Git show [commit Id] – displays metadata and content changes for a commit.
  18. Git show [commit Id] — -stat — Displays the name of the committed file
  19. Git Checkout – Restore all files in the staging area.
  20. Git reset [file/commit ID] – Resets a specified file in the staging area. Used to revoke git commit
  21. 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.
  22. Git cherry-pick temp — merge temporary branches into current branches.
  23. Git commit — amend — Modify the last commit description and merge the commit. Invalid for pushed.
  24. 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