Branch operation
Git branch creating branch
Git checkout - b Create and switch to the newly created branch
Git checkout switching branches
Git branch view branch list
Git branch - v View the last operation of all branches
Git branch - vv View current branch
Git brabch - b branch name origin/branch name Create remote branch to local
Git branch -- merged View other branches and branches that have been merged with the current branch
Git branch -- no merged View branches that have not been merged with the current branch
Git branch - d branch name delete local branch
Git branch - D branch name forcibly deleting branch
Git branch origin: branch name delete remote warehouse branch
Git merge branch name merges the branch onto the current branch
Staging operation
Git stash staging current modifications
Git stash apply restores the most recent temporary save
Git stash pop restores temporary storage and deletes temporary records
Git staging list to view the staging list
Git stash drop temporary storage name (example: stash @ {0}) to remove a certain temporary storage
Git stash clear clear
fallback action
Git reset -- hard HEAD ^ Fallback to previous version
Git reset -- hard ahdhs1 (commit_id) fallback to a certain version
Git checkout -- file to undo the modified file (if the file is added to the staging area, it will be rolled back to the staging area; if the file is added to the version library, it will be restored to its state after being added to the version library)
Git reset HEAD file to recall files from the staging area and modify them to the workspace
Label operation
Add tags to the git tag tag name (default for the current version)
Git tag tag name commit_ ID tags a submission record
Git tag - a tag name - m 'description' Create a new tag and add a comment
Git tag List all tags
Git show tag name to view tag information
Git tag - d tagname delete local tag
Git push origin tag name push tags to remote warehouse
Git push origin -- tags Push all tags to remote warehouse
Git push origin: refs/tags/tag name Delete tags from remote warehouse
Other operations
General Operations
Git push origin test pushes local branches to remote warehouses
Git rm - r -- cached file/folder name cancel file under version control
Git reflog to obtain executed commands
Git log -- graph View branch merge graph
Git merge -- no ff - m 'merge description' Branch names are not merged using the Fast forward method, and merging records can be seen by using this method
Git check ignore - v file name view ignore rule
Git add - f filename force file submission
Git Create Project Warehouse

  1. Git init initialization
  2. Git remote add origin URL associated with remote warehouse
  3. Git pull
  4. Git fetch to obtain all branches from the remote warehouse to the local location
    Ignore files that have been added to the version library
  5. Git update index -- assume-unchanged file Ignore individual files
  6. Git rm - r -- cached file/folder name (. Ignore all files)
    Cancel Ignoring Files
    Git update index -- no issue unchanged file
    Pull and upload password free
    Git config -- global credential. helper store

标签: none

添加新评论