我正在使用Visual Studio 2013的Git支持来处理私有GitHub存储库.我有权承诺.我想切换分支,但是当我转到分支视图时,任何列表中的唯一分支(分支下拉列表,已发布分支,合并工具)都是主分支.其他分支出现在GitHub,GitHub for Windows和TortoiseGit中.所以我知道他们在那里,我可以访问.
任何想法为什么我在Visual Studio中看不到其他分支?

我正在运行Visual Studio 2013 Update 2.
我正在尝试将新的本地分支推product-0.2送到远程,其中已经存在具有相同名称的标记(但分支本身不存在)
git push -v --tags --set-upstream origin product-0.2:product-0.2
Pushing to https://****@github.com/mycompany/product.git
error: src refspec product-0.2 matches more than one.
error: failed to push some refs to 'https://****@github.com/mycompany/product.git'
Run Code Online (Sandbox Code Playgroud)
与:相同:
git push origin product-0.2:/refs/heads/product-0.2
Run Code Online (Sandbox Code Playgroud)
虽然相反的方式有效,例如创建一个分支product-0.1,然后提交它然后应用标记product-0.1.
有些人通过在本地删除冲突标记,然后推送分支,然后检索远程标记来解决这个问题,但它看起来很麻烦且容易出错.
如何以最小的麻烦创建我的分支?
感谢您的输入
我需要一些Bash脚本的帮助,它会自动将git的分支名称添加为提交消息中的哈希.
当我浏览GitHub存储库时,我经常看到"wip"分支(例如3.1.0-wip)."wip"是什么意思?
我无法在任何地方找到答案 - 无论是在Google上还是在GitHub上:帮助.
我有一个名为' my_local_branch' 的本地分支,它跟踪一个远程分支origin/my_remote_branch.
现在,远程分支已经更新,我正在' my_local_branch'并且想要引入这些变化.我应该这样做:
git pull origin my_remote_branch:my_local_branch
Run Code Online (Sandbox Code Playgroud)
这是正确的方法吗?
git-config的手册页列出了push.default的这些选项:
nothing - do not push anything.
matching - push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default.
upstream - push the current branch to its upstream branch.
tracking - deprecated synonym for upstream.
current - push the current branch to a branch of the same name.
Run Code Online (Sandbox Code Playgroud)
在大多数情况下,我会假设推送到分支的上游分支与推送到同名分支相同,因为上游分支通常具有相同的名称,并且因为同名的分支("当前" )通常(或总是按定义?)是上游.那有什么区别?
UPDATE:为的git-config中的男子页面已经更新(如人们所期望的),这样的区分做出有可能是一个更加清晰了.
它说,在git社区书中
您可以做的另一个有趣的事情是使用'--graph'选项可视化提交图,如下所示:
Run Code Online (Sandbox Code Playgroud)$ git log --pretty=format:'%h : %s' --graph * 2d3acf9 : ignore errors from SIGCHLD on trap * 5e3ee11 : Merge branch 'master' of git://github.com/dustin/grit |\ | * 420eac9 : Added a method for getting the current branch. * | 30e367c : timeout code and tests * | 5a09431 : add timeout protection to grit * | e1193f8 : support for heads with slashes in them |/ * d6016bc : require time for xmlschema它将为提交历史记录行提供非常好的ASCII表示.
我该如何阅读此图表?如何420eac9从剩下的有什么不同?
我们希望为我们的项目强制执行一个新策略,现在主分支称为发布分支,以确保更清楚如何使用分支.当然,我们也将开发和发布候选分支.
我知道我可以通过简单地使用以下命令在本地重命名master分支:
git branch -m master release
Run Code Online (Sandbox Code Playgroud)
但是,这只是本地的.即使我把它推到遥控器上,HEAD仍然指向远程主分支.我想完全摆脱master分支,并在初始克隆时创建默认的本地分支,然后释放.
我怎样才能做到这一点?
编辑:似乎由于原点是在一个有名的服务器上,我得到错误删除主分支.我现在试图看看是否可以更改它,以便默认分支是'release'.
假设您的git commit历史如下所示:
A---B---C---D---E---F master
\ /
X---Y---Z topic
Run Code Online (Sandbox Code Playgroud)
是否可以让git列表只有master,AF上的提交?换句话说,如果提交是在合并分支上,我不希望它显示.