Git commands that are frequently used on the git front end

Summary of front-end GIT commands

1. Getting started

Mainly refers to pulling items from remote clone

command Description
git init Initialize a warehouse
git clone'Your warehouse address' Clone project from remote repository
git add . Add local files to the staging area
git commit -m'Description of this submission' Submit local modified files to the current branch
git push origin master Upload local modified files to remote warehouse storage
  • ps: You need to enter your github account and password, if the account password is wrong, perform the steps again

Second, the command encyclopedia

Mainly refers to common operations on local and remote branches

command Description
git remote -v View remote warehouse
git push remote branch name master Submit local branch to remote
git pull remote branch name local branch name Pull branch to local
git push -f remote warehouse name master Mandatory commit to cover the remote branch
git config --global user.name Local username
git config --global http.postBuffer 99999999999 Configure memory, increase pull/push speed
git config –-global user.email “**” Local mailbox
git branch -a View all branches
git branch The command will list all branches, and the current branch will be marked with an *
git branch -D branch name Delete a local branch
git push origin --delete branch name Delete remote branch name
git remote rm warehouse name Delete a remote warehouse
git checkout -b branch name Create a branch and switch to that branch
git checkout branch name Switch to a branch
git merge branch name Merge the specified branch to the current branch
git checkout-file name Discard workspace modification
git reset --hard HEAD^ Roll back to the previous version, you can discard the temporary storage area modification
git reset --hard submitted id Roll back to the specified version
go rm Delete Files
git log View submission record
git log --pretty=oneline View brief information of submission records
git branch --set-upstream-to=origin/ remote branch name local branch name Establish a local branch to connect with a remote warehouse

Guess you like

Origin blog.csdn.net/m0_46442996/article/details/107219058