扫码关注官方订阅号
git clone -b feature-notice https://....
克隆这个分支后 git branch,在feature-notice下,现在想pull/fetch线上最新的代码 ,修改后 commit /push
具体如何做? 直接git pull / fetch 都不行,还有commit / push
人生最曼妙的风景,竟是内心的淡定与从容!
你如果克隆的是自己的仓库中的代码,也是不应该是使用https协议的.应该使用ssh协议.ssh协议就需要用户名和密码,或者使用ssh-key免密上传.你如果是克隆别人的代码.是pull不了的.要上传,你可以上传到自己的代码仓库.去github申请个账号.将你克隆下的仓库添加github上的地址,使用git remote add
第一步:新建分支以一个已存在的远程分支为源新建分支:git checkout -b local_branch_name origin/remote_branch_name比如:git checkout -b feature0001 origin/master这样就克隆master分支新建了一个feature0001分支第二步:提交新建分支到远程git push --set-upstream origin local_branch_name这里即:git push --set-upstream origin feature0001这时你的feature0001分支可以在远程看到了,之后修改、提交你应该会了。第三步:其他的命令查看当前分支(本地分支和本地已检出的远程分支):git branch查看所有分支(包括远程分支):git branch -av切换分支(本地已有的分支):git checkout branch_name切换到远程分支:git checkout remotes/origin/branch_name有问题再交流哦~
git checkout -b local_branch_name origin/remote_branch_name
git checkout -b feature0001 origin/master
git push --set-upstream origin local_branch_name
git push --set-upstream origin feature0001
git branch
git branch -av
git checkout branch_name
git checkout remotes/origin/branch_name
直接git pull 不行,是怎么个不行法?提示什么
楼主 你git clone的是http协议的,所以要输入密码,可以用ssh协议的。
你pull或者push的时候加上远程分支试试git pull origin feature-noticegit push origin feature-notice
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
你如果克隆的是自己的仓库中的代码,也是不应该是使用https协议的.应该使用ssh协议.
ssh协议就需要用户名和密码,或者使用ssh-key免密上传.
你如果是克隆别人的代码.是pull不了的.
要上传,你可以上传到自己的代码仓库.去github申请个账号.将你克隆下的仓库添加github上的地址,使用git remote add
第一步:新建分支
以一个已存在的远程分支为源新建分支:
git checkout -b local_branch_name origin/remote_branch_name比如:
git checkout -b feature0001 origin/master这样就克隆master分支新建了一个feature0001分支
第二步:提交新建分支到远程
git push --set-upstream origin local_branch_name这里即:
git push --set-upstream origin feature0001这时你的feature0001分支可以在远程看到了,之后修改、提交你应该会了。
第三步:其他的命令
查看当前分支(本地分支和本地已检出的远程分支):
git branch查看所有分支(包括远程分支):
git branch -av切换分支(本地已有的分支):
git checkout branch_name切换到远程分支:
git checkout remotes/origin/branch_name有问题再交流哦~
直接git pull 不行,是怎么个不行法?提示什么
楼主 你git clone的是http协议的,所以要输入密码,可以用ssh协议的。
你pull或者push的时候加上远程分支试试
git pull origin feature-notice
git push origin feature-notice