git分支合并的,拉取远程分支,合并到本地等不同情况下git的操作命令

情况1: 本地有分支dev,远程没有dev分支,要将本地dev分支提交到远程的dev分支

首先切换到dev分支: git  checkout dev

    检测是否有为提交内容:git status

    将未提交内容添加到暂存区: git add .(或git add 具体文件名称)

       将暂存区内容提交到

原文地址:https://www.cnblogs.com/fanlina/p/11002799.html

时间: 2024-08-12 15:27:07

git分支合并的,拉取远程分支,合并到本地等不同情况下git的操作命令的相关文章

git拉取远程分支并创建本地分支

本地分支推送至远程 git checkout local_branch git push origin local_branch:remote_branch 一.查看远程分支 使用如下Git命令查看所有远程分支: git branch -r 列出本地分支: git branch 删除本地分支: git branch -D BranchName 其中-D也可以是--delete,如: git branch --delete BranchName  删除本地的远程分支: git branch -r

git 拉取远程分支报错(fatal: '' is not a commit and a branch '' cannot be created from it)

问题描述从远程git上拉取某一个分支,然后报错,拉取不了这个分支. 拉取分支的命令: git checkout -b xxx-static-19 origin/xxx-static-19 其中xxx-static-19是分支名. 报错 fatal: 'origin/xxx-static-19' is not a commit and a branch 'xxx-static-19' cannot be created from it 解决重新拉取数据,git pull ,然后再切回分支 git

删除本地分支,并重新拉取远程分支复制到本地

1. 删除本地分支 假设想要删除本地的分支temp,并且当前处在temp分支上,首先需要切换到别的分支(假设切换到develop分支): git checkout develop //切换到develop分支 git branch //此时处在develop分支 git branch -D temp //删除本地temp分支 2.重新拉取远程仓库代码,并自动创建分支 git fetch 会将远程代码的更新(commit)拉取到本地. git fetch origin temp:temp //拉取

【记录】git 拉取远程分支代码,同步到另一个git上

最近有需求从某git 上拉取所有分支代码同步到另一git上,现记录操作步骤,以便日后使用: 1:先克隆其中一个分支代码到本地环境 git clone -b test http://账号:密码@XXX.git 2:查看本地分支 git brach 3:查看远程分支 git branch -r 4:查看远程所有分支  远程分支会用红色表示出来(如果你开了颜色支持的话 git branch -a 5:-a命令并没有每一次都从远程更新仓库信息,我们可以手动更新一下 git fetch origin gi

Git拉取远程分支命令

如果我们想从Git仓库中拉取一个分支到本地,此处假如远程分支为develop,本地要创建的分支为dev,可以使用以下命令: git init    //初始化本地Git仓库 git remote add origin https://xxx.git  //将本地仓库和远程仓库相关联 git fetch origin develop git checkout -b dev origin/develop //在本地创建分支dev,并将远程分支develop的信息同步到本地分支dev 这样我们就拉取了

git拉取远程分支并切换到该分支

整理了五种方法,我常用最后一种,这五种方法(除了第4中已经写了fetch的步骤)执行前都需要执行git fetch来同步远程仓库 (1)git checkout -b 本地分支名 origin/远程分支名 (2)git checkout --track origin/远程分支名 (这种写法是上面的简化版,效果完全一样) (3)git checkout -t origin/远程分支名(这种写法是2的简化版) (4)fetch指定的一个分支:git fetch [repo] [remote_bran

拉取远程分支

https://blog.csdn.net/carfge/article/details/79691360 开始拉代码的操作链接 git branch -r 查看远程所有分支 git fetch origin 远程分支名x:本地分支名x 会创建本地分支,但是和远程分支没有映射关系 git branch 查看本地分支名 git checkout 分支名 切换当前分支 git branch -u origin 与远程分支建立映射关系 再git pull拉取远程代码就可以了 原文地址:https://

git使用命令行拉取远程代码仓库中的分支至本地

1.本地创建文件夹用于存放拉取的代码 2.执行git init初始化文件夹 3.与远程代码仓库建立连接 git remote add origin [email protected]/nothing.git(远程代码仓库链接地址) 4.切换分支拉取代码(wyl为远程代码仓库分支名) git fetch origin wyl(更新分支最新状态) git checkout -b wyl(切换分支) git pull origin wyl(拉取代码) 原文地址:https://www.cnblogs.

git拉取远程分支到本地分支或者创建本地新分支

git fetch origin branchname:branchname 可以把远程某各分支拉去到本地的branchname下,如果没有branchname,则会在本地新建branchname git checkout origin/remoteName -b localName 获取远程分支remoteName 到本地新分支localName,并跳到localName分支