branch

git refname 'origin/master' is ambiguous

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a git repository that is tracking several remote branches: $ git branch - a * master remotes / git - svn remotes / origin / master remotes / trunk When I try to setup a default one I get the following error: $ git branch -- set - upstream - to = origin / master master warning : refname 'origin/master' is ambiguous . fatal : Ambiguous object name : 'origin/master' . I would like to kremove some of the remote master branches but the master references are still there. How can I remove them to be able to set the default upstream

How to resolve git's “not something we can merge” error

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I just encountered a problem when merging a branch into master in git. First, I got the branch name by running git ls-remote . Let's call that branch "branch-name". I then ran git merge branch-name command and got the following result: fatal: branch-name - not something we can merge How do I resolve this error? 回答1: As shown in How does "not something we can merge" arise? , this error can arise from a typo in the branch name because you are trying to pull a branch that doesn't exist. If that is not the problem (as in my case), it is likely

Is there a git-merge --dry-run option?

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm merging in a remote branch that may have a lot of conflicts. How can I tell if it will have conflicts or not? I don't see anything like a --dry-run on git-merge . 回答1: As noted previously, pass in the --no-commit flag, but to avoid a fast-forward commit, also pass in --no-ff , like so: $ git merge -- no - commit -- no - ff $BRANCH To examine the staged changes: $ git diff -- cached And you can undo the merge, even if it is a fast-forward merge: $ git merge -- abort 回答2: I just had to implement a method that automatically finds

Merge trunk to branch in Subversion

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Subversion 1.4.6, and I cannot upgrade to version 1.5 right now. The situation: The trunk has a lot of structural changes (i.e. moving files around, mostly). I have a branch that was recently merged from the trunk, but before the major changes. What is the best way to merge the trunk to the branch? What I had in mind: First carefully merge the branch to the trunk, by merging only the modified files in the branch to the trunk. Copy the trunk to the branch. What is the best way to do this without losing the branch history? Should I

Git merge errors

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a git branch called 9-sign-in-out with perfectly working code, and I want to turn it into the master. I'm currently on the master branch. $ git branch 9-sign-in-out * master I'm trying to switch to 9-sign-in-out branch, but it doesn't allow me to: $ git checkout 9-sign-in-out app/helpers/application_helper.rb: needs merge config/routes.rb: needs merge error: you need to resolve your current index first Any idea how can I ignore all the master branch errors and turn the 9-sign-in-out branch into the master? Maybe git rebase ? But I don

git fetch vs. git fetch origin master have different effects on tracking branch

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is mostly of the nature of a curiosity as I'm trying to get familiar with Git. I have looked at the documentation for 'git fetch' but I don't see an obvious explanation for the below. Thanks in advance, and apologies if this is howlingly obvious. 1) From a central repository, say GitHub, I clone a repository named website on each of two machines, HostA and HostB . 2) on HostA , I make a change to a file, say README.txt , and commit it. At this point on HostA , the commits for branches master and origin/master are, as expected different

Select Git branch for TeamCity Build

匿名 (未验证) 提交于 2019-12-03 01:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm wondering how to select the branch to build against using Team City 8.1. My VCS root (Git) is set to Default: "master" and Branch specifications are +:refs/heads/develop +:refs/heads/feature/* +:refs/heads/hotfix/* +:refs/heads/master +:refs/heads/release/* I have a CI build set up that automatically builds anything that is checked in, which is working exactly how I want. What I'd like to do is create a scheduled QA build/deployment against the "develop" branch. I see that if I click the ellipsis next to the run button, I can choose the

git merge: apply changes to code that moved to a different file

匿名 (未验证) 提交于 2019-12-03 01:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am attempting a pretty beefy git merge maneuver right now. One problem that I am coming across is that I made some changes to some code in my branch, but my colleague moved that code to a new file in his branch. So when I did git merge my_branch his_branch , git did not notice that the code in the new file was the same as the old, and so none of my changes are there. What's the easiest way to go about applying my changes again to the code in the new files. I won't have too many problems finding out which commits need to be reapplied (I can

Why call git branch --unset-upstream to fixup?

匿名 (未验证) 提交于 2019-12-03 01:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm more of a novice when it comes to advanced operations in git. I maintain my blog using the blogging framework Octopress . Though Octopress is not under any development since 2011, it serves my purpose well and so I haven't thought of changing anything so far. FYI, my blog is hosted on Github Pages. Today, while working on a new post, git status showed the following message: On branch source Your branch is based on 'origin/master', but the upstream is gone. (use "git branch --unset-upstream" to fixup) The same message repeated for all the

Git rebase: conflicts keep blocking progress

匿名 (未验证) 提交于 2019-12-03 01:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a git branch (called v4), that was made from master just yesterday. There were a couple of changes to master, that I want to get into v4. So, in v4, I tried to do a rebase from master, and one file keeps screwing things up: a one-line text file, that contains the version number. This file is app/views/common/version.txt , which before rebasing contains this text: v1.4-alpha-02 Here's what I'm doing: > git rebase master First, rewinding head to replay your work on top of it... Applying: new version, new branch error: patch failed: app