Git common command notes git undo add operation before submission problem: when using git, before not added. use git add before the ignore file. add all files to the database, and accidentally add some files that do not need to be added to the version database. The HEAD version does not exist because it has not been submitted yet. You cannot use the git reset HEAD command. Solution: Use git rm-r -- cached. ps: note that the last step is a bit. Commit rewrite the last commit git commit-m' rewrite the last commit 'git add forgotten_file // add the file git commit -- amend ---------------------------------------------- remote commit git remote add [shortname] [url] // Add remote repository git remote-v // list remote repository git remote show [remote-name] // list remote repository details git remote rename old-name new-name // Rename the remote repository git remote rm [remote-name] // Delete the remote repository ---------------------------------------- fetch pull git fetch [remote-name] // pull the remote data to the local repository, it is not automatically merged to the current branch and still needs to be manually merged. Using tag pull git tag v1 // create tag git tag-a v1-m' create tag 'git show v1 // view tag version information ------------------------------------ automatic complementing function in linux -------------------------------------- in git Source git-completion in the contrib/completion directory. copy bash to your user directory. And add the following content to your. bashrc file source ~ /. Git-completion.bash --------------------------------- set Git command alias ------------------------------------------------- git config -- global alias. co checkout // set the checkout command alias git config -- global alias.br branch // set the branch command alias git config -- global alias. ci commit // set the commit command alias git config -- global alias. st status // set the status Command alias git config -- global alias. last 'Log-1 head' // view the last commit information git config -- global Lias. visual "! Gitk "// start gitk. To run an external command, you only need to add it before the command!.