Share the common process of git (less detours)

Premise: Shortcuts can be taken, but the content under this article also needs to be understood

Basic use of git: Basic use of Git (very detailed)_❆VE❆'s Blog - CSDN Blog

  • clone clone code (copy code, you can also use git command later) 
git clone "代码路径(码云上)"
  • pull code (can also be understood as updating the code, merging the latest code with the code you changed, if you encounter code conflicts, manually resolve the conflicts on your own development tools) 
//(拉取代码)
git pull
  • add add to cache 
//将当前所有文件添加到缓存区
git add .
  • Commit is added to the local library ( if you add --no-verify: it means skip the check )
git commit -m '提交内容' --no-verify
  • push upload to the remote library

        -- Upload directly to the corresponding branch ( see the article I gave for the new branch )

git push origin 本地分支(master/原有分支名/新建分支名)

        -- Convenient method: (Note - local branch: a new branch created by yourself ) The local branch indicates which branch you need to pull a new branch from, which can be the main branch or other branches. If the remote No branch, it will be created automatically

//上传到远程仓库
git push origin 本地分支:远程分支
  • status Check the status -- check the path of the changed files, that is, the files you changed
git status

(You must practice more and understand more. Not all knowledge is a fixed logic, and you will have your own understanding after practice)

Guess you like

Origin blog.csdn.net/qq_45796592/article/details/130637931