# test **Repository Path**: cjj_fighting/test ## Basic Information - **Project Name**: test - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-04-26 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # test #### Description {**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} ### git提交代码并解决冲突方法 - git add . - git commit -m "提交内容" - git fetch - git rebase origin/远程分支名 (这里如果有冲突会提示有冲突的文件名) - git am --show-current-patch 查看有冲突的文件(这个只是一个文件中的冲突,然后打开你的代码,修改冲突) - git add 冲突文件名 - git rebase --continue(提示你要把所有冲突都解决,如果没有可解决的冲突文件就直接退出了rebase) - git am --show-current-patch(继续执行这3次操作直到退出rebase) - git commit -m "提交修改完的代码" - git push origin 远程分支:本地分支名 ### git将远程分支上的代码拉到本地 - git pull origin 远程分支:本地分支(默认是将远程主分支上的代码拉到本地) ### git使用命令创建远程分支 - git checkout -b test origin/master (基于远程住分支创建本地test分支) - git push origin test:test(将本地test分支推送到远程) ### git创建本地分支 - git branch test(创建完成后不切换) ### git查看分支 - git branch(查看本地分支) - git branch -a 查看所有分支包含远程分支和本地分支 ### git切换分支 - git checkout test(分支名,如果当前不存在该分支会报错) ### git删除分支 - git branch -d test(删除本地分支) - git branch -D test(强制删除本地分支) - git push origin :test(将本地空分支推送到远程分支,即删除远程分支) ### git add三种不同的添加方式区别 - git add . (监控工作区的状态树,使用它会把工作时的所有变化提交到暂存区,包括文件内容修改(modified)以及新文件(new),但不包括被删除的文件) - git add -u (仅监控已经被add的文件,即(tracked file),他会将被修改的文件提交到暂存区,不会提交新文件(untracked file)) git add --update的缩写 - git add -A (是上面两个功能的合集) ### git强拉代码到本地 - git fetch --all - git reset --hard origin/分支名 ### git分支合并 - git checkout master(首先切换到主分支上) - git merge test(这里是要合并的分支名) - git push origin master(推送到远程主分支) ### git rebase错分支解决办法 - https://blog.csdn.net/darongzi1314/article/details/84677729 ### git创建并提交到远程代码 - 参考地址: https://blog.csdn.net/csj731742019/article/details/82773581 - 从已有git上拉master代码到本地 - git checkout -b dev (在本地创建一个分支dev) - git push --set-upstream origin dev (将本地dev分支推送到远程) - git checkout -b dev origin/dev(创建dev分支,并将代码拉去到本地) ### git合并分支 - git merge dev 将dev分支合并到本分支 - git push origin 分支名 推送到远程分支 ### git clone 远程分支(指定某一分支) git clone -b 远程分支名 代码仓库地址 ### git提交报错 ```javascript husky > pre-commit (node v10.15.3) Stashing changes... [started] Stashing changes... [skipped] → No partially staged files found... Running linters... [started] Running tasks for src/**/*.{js,vue} [started] eslint --fix [started] eslint --fix [failed] → Running tasks for src/**/*.{js,vue} [failed] → Running linters... [failed] × eslint --fix found some errors. Please fix them and try committing again. D:\PRO\VUE\blockchain-web\src\views\wallet\components\wallet.vue 103:15 error Expected '===' and instead saw '==' eqeqeq 105:11 error 'ipcRenderer' is not defined no-undef 106:11 error 'ipcRenderer' is not defined no-undef 141:11 error 'ipcRenderer' is not defined no-undef 142:11 error 'ipcRenderer' is not defined no-undef D:\PRO\VUE\blockchain-web\src\views\transfer\components\transfer.vue 131:17 error 'outs' is assigned a value but never used no-unused-vars D:\PRO\VUE\blockchain-web\src\utils\request.js 49:25 error Expected '===' and instead saw '==' eqeqeq ✖ 7 problems (7 errors, 0 warnings) husky > pre-commit hook failed (add --no-verify to bypass) ``` - 解决方法 `git commit --no-verify -m "xxxxxxxxxxxxx"` ### git push 报错 ``` To https://gitee.com/codingapi/assessment-system.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://gitee.com/codingapi/assessment-system.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. ``` - 解决方法 https://blog.csdn.net/u013120247/article/details/53263169