简体   繁体   English

获得合并分支的最佳方式与 master 不同

[英]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 .有两个分支masterdevelop 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.

相关问题 将修补程序合并到功能分支中之前,将其修复到功能分支中的最佳方法是什么? - What's the best method to get a fix into a feature branch before it's been merged into master? 对于需要master不断合并的git分支,最佳做法是什么? - What's the best practice for a git branch that needs master to be constantly merged to it? 如果将其中一个合并到母版,更新从功能分支中获取的姊妹子功能分支的最佳方法是什么? - What's the best way to update sister sub-feature branch taken from feature branch if one of them is merged to master? 将分支合并到 master 和另一个分支的最佳方法是什么? - What is the best way to merge a branch into master AND another branch? 在多个master分支上使用git的最佳方法是什么? - What's best way to work with git on multiple master branch? 将我的原点/主节点移动到新分支的最佳方法是什么? - What's the best way to move my origin/master to a new branch? 命令“ git branch --merged master”中的“ master”是什么意思? - What does 'master' mean in command “git branch --merged master”? 在Git中分支到除master分支之外的任何其他分支时,添加警告的最佳方法是什么 - Whats the best way to add warning when branching off any other branch than master branch in Git 有可能告诉Github我的分支被合并到上游主人吗? - Is it possible to tell Github that my branch was merged into upstream master? 在VSTS中,当dev分支具有策略时,将dev分支重新整理为要掌握的最佳方法是什么 - In VSTS, what is the best way to rebase a dev branch to master when dev branch has policies
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM