简体   繁体   English

Git默认分支问题

[英]Git default branch issue

I'm new to git and I'm working with another developer. 我是git的新手,并且正在与另一位开发人员一起工作。 I want whenever I do git pull or git push to only affect the development branch. 我希望每当执行git pullgit push ,仅影响开发分支。 I went to .git/config but I don't understand what is there. 我去了.git / config但我不明白那里是什么。 Any pointers would be much appreciated. 任何指针将不胜感激。

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = https://github.com/Zeasdfasdf4/m2ex2
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "development"]
    remote = origin

You can't switch branches with your gitconfig. 您不能使用gitconfig切换分支。 How can do this, however, with the git checkout command. 但是,如何使用git checkout命令执行此操作。

Simply run git checkout development to switch to this branch. 只需运行git checkout development即可切换到该分支。 This also means that pulls and pushes will interact with the remote development branch (instead of the remote master branch). 这也意味着推和推将与远程开发分支(而不是远程主分支)交互。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM