[英]What is the best possible way to get a merged branch is different than master
I have started a job.我已经开始工作了。 I am responsible for updating the server with the latest commits as well.
我也负责用最新的提交更新服务器。 Forgive me if the question has been asked and I could not trace it.
如果问题已被问到但我无法追踪,请原谅我。
There are two branches master
and develop
.有两个分支
master
和develop
。 In my case develop
is the default branch.在我的例子中
develop
是默认分支。
I made a feature branch and pushed it to the remote repository.我创建了一个功能分支并将其推送到远程存储库。 Now I don't remember that I made my feature branch from
master
or develop
but the branch is merged in develop
after feedback from client.现在我不记得我是从
master
还是develop
创建了我的功能分支,但是在客户反馈后该分支被合并到develop
中。
I logged in to server and checked the pointing branch by using git branch
the branch pointer is on master
I fetched the latest and took a pull but I got the message Already up to date
But My code is not updated.我登录到服务器并使用
git branch
检查了指向分支,分支指针在master
分支上我获取了最新的并进行了拉动但我收到消息Already up to date
的但是我的代码没有更新。 But When I followed the same procedure on my local system it fetched the master and pulled the latest code.但是当我在我的本地系统上执行相同的过程时,它获取了 master 并提取了最新的代码。 My local is also pointing to
master
我的local也指向
master
I checked onto develop
on live but it is 132 commits behind I cannot make the mistake of fetching because the application can break.我检查了实时
develop
,但它落后了 132 次提交,我不能犯抓取的错误,因为应用程序可能会中断。 Kindly help me understand the concept of default and main branch and also How can I update server safely with only my feature branch请帮助我理解默认和主分支的概念,以及如何仅使用我的功能分支安全地更新服务器
A git fetch
would only fetch commits, without merging to your current branch, so no code would be updated. git fetch
只会获取提交,不会合并到当前分支,因此不会更新任何代码。
A git pull
would fetch+merge. git pull
将获取+合并。
I cannot make the mistake of fetching because the application can break.
我不能犯抓取的错误,因为应用程序可能会中断。
Fetching will not impact your application, will not move HEAD.获取不会影响您的应用程序,不会移动 HEAD。
In your case, I recommend a git log --decorate --oneline --graph --all --branches
, in order to see where HEAD is, on which branch.在你的情况下,我推荐一个
git log --decorate --oneline --graph --all --branches
,以便查看HEAD 在哪里,在哪个分支上。
From there, you can deduce where you need to be.从那里,您可以推断出您需要去哪里。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.