git
高兴就好(石
这个作者很懒,什么都没留下…
展开
-
git clone -b 下载指定分支的代码
1.git clone 不指定分支 git clone https://github.com/apache/hadoop.git2.git clone 指定分支git clone -b branch-2.9.2 https://github.com/apache/hadoop.git其中的branch-2.9.2就是版本号原创 2021-12-15 21:25:29 · 2575 阅读 · 0 评论 -
Git冲突:commit your changes or stash them before you can merge.
发现冲突,可以直接commit;在本地解决冲突。另外,也可以暂时保存本地修改或者直接放弃本地修改1.暂时保存本地修改git stash 备份当前的工作区,从上一次提交中读取,让工作区和上次提交的内容一致。同时,将当前的工作区内容保存到Git栈中。git pull 拉取代码git stash pop 从Git栈中读取最近一次保存的内容,即刚刚保存的内存#关于git栈的管理git stash list 显示Git栈内的所有备份,一般可以选择从哪个地方恢复。git stash clear: 清.原创 2021-10-19 11:23:16 · 312 阅读 · 0 评论 -
git-远程仓库的使用;单个项目配置用户名和邮箱
1.查看远程仓库:git remote -v2.查看本地分支:git branch3.添加远程仓库:git remote add [] 4.从远程仓库获取最新版本代码:git fetch tang master:temp(从远程的tang仓库中的master分支下载到本地的master分支,并新建一个temp分支)注意:不建议使用pull拉取最新代码,因为pull拉取下来后会自动和本地分支合并获取最新版本有两种 :拉取(pull)和获取(fetch)git pull 从远程拉取原创 2021-10-19 10:51:48 · 496 阅读 · 0 评论 -
git基本命令、提交pr
1.先fork到自己的GitHub中2.下载代码到本地:git clone+地址3.创建并切换分支:3.1 git status # 查看当前git仓库状态, 确认处于master分支中3.2 git branch pr-test # 从master分支分出为pr-test的分支(查看本地有哪些分支:git branch)(删除分支:git branch -d 分支名)3.3 git checkout pr-test # 切换至pr-test分支4.修改文档等5.上传代码到仓库(原创 2021-10-19 10:46:28 · 5049 阅读 · 0 评论 -
git clone 指定私钥文件
当默认的私钥不对的时候,一般会有类似报错:git clone git@******Cloning into ‘******’…Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.比较方便的解决方法如下:目前发现的缺陷就是,缓存会随着电脑重原创 2021-10-19 10:40:12 · 3693 阅读 · 1 评论