如何在idea里切换项目不同分支
引言:
在学会这种方法之前,讲道理,我在不同分支开发的方法有点蠢,介绍下我在这之前的方法。
把要开发的不同分支都给拉到本地来,git clone -b 分支 项目地址
然后用idea打开多个项目窗口,不会这种方法之前,确实觉得也还好,但是学会了在idea里来回切换分支之后,就感觉这种方法有点蠢了。
窗口右下角
1:点击
2:查看本地分支和远程分支
第一个红框表示是本地的分支,如果要切换非当前的本地分支,直接点击,然后选择check out
pic-1596529689192.png
第二个红框表示远程分支,如果要切换当前分支为服务器上的远程分支,那么直接点击,然后选择checkout As ...
pic-1596529689193.png
%23%20%E5%A6%82%E4%BD%95%E5%9C%A8idea%E9%87%8C%E5%88%87%E6%8D%A2%E9%A1%B9%E7%9B%AE%E4%B8%8D%E5%90%8C%E5%88%86%E6%94%AF%0A**%E5%BC%95%E8%A8%80%EF%BC%9A**%0A%3E%20%E5%9C%A8%E5%AD%A6%E4%BC%9A%E8%BF%99%E7%A7%8D%E6%96%B9%E6%B3%95%E4%B9%8B%E5%89%8D%EF%BC%8C%E8%AE%B2%E9%81%93%E7%90%86%EF%BC%8C%E6%88%91%E5%9C%A8%E4%B8%8D%E5%90%8C%E5%88%86%E6%94%AF%E5%BC%80%E5%8F%91%E7%9A%84%E6%96%B9%E6%B3%95%E6%9C%89%E7%82%B9%E8%A0%A2%EF%BC%8C%E4%BB%8B%E7%BB%8D%E4%B8%8B%E6%88%91%E5%9C%A8%E8%BF%99%E4%B9%8B%E5%89%8D%E7%9A%84%E6%96%B9%E6%B3%95%E3%80%82%0A%3E%20%E6%8A%8A%E8%A6%81%E5%BC%80%E5%8F%91%E7%9A%84%E4%B8%8D%E5%90%8C%E5%88%86%E6%94%AF%E9%83%BD%E7%BB%99%E6%8B%89%E5%88%B0%E6%9C%AC%E5%9C%B0%E6%9D%A5%EF%BC%8Cgit%20clone%20-b%20%E5%88%86%E6%94%AF%20%E9%A1%B9%E7%9B%AE%E5%9C%B0%E5%9D%80%0A%3E%20%E7%84%B6%E5%90%8E%E7%94%A8idea%E6%89%93%E5%BC%80%E5%A4%9A%E4%B8%AA%E9%A1%B9%E7%9B%AE%E7%AA%97%E5%8F%A3%EF%BC%8C%E4%B8%8D%E4%BC%9A%E8%BF%99%E7%A7%8D%E6%96%B9%E6%B3%95%E4%B9%8B%E5%89%8D%EF%BC%8C%E7%A1%AE%E5%AE%9E%E8%A7%89%E5%BE%97%E4%B9%9F%E8%BF%98%E5%A5%BD%EF%BC%8C%E4%BD%86%E6%98%AF%E5%AD%A6%E4%BC%9A%E4%BA%86%E5%9C%A8idea%E9%87%8C%E6%9D%A5%E5%9B%9E%E5%88%87%E6%8D%A2%E5%88%86%E6%94%AF%E4%B9%8B%E5%90%8E%EF%BC%8C%E5%B0%B1%E6%84%9F%E8%A7%89%E8%BF%99%E7%A7%8D%E6%96%B9%E6%B3%95%E6%9C%89%E7%82%B9%E8%A0%A2%E4%BA%86%E3%80%82%0A%0A%0A%23%23%20%E7%AA%97%E5%8F%A3%E5%8F%B3%E4%B8%8B%E8%A7%92%0A%0A**1%EF%BC%9A%E7%82%B9%E5%87%BB**%0A!%5B9a8844b11b95131ec5040572559af645.png%5D(en-resource%3A%2F%2Fdatabase%2F2737%3A0)%0A%0A**2%EF%BC%9A%E6%9F%A5%E7%9C%8B%E6%9C%AC%E5%9C%B0%E5%88%86%E6%94%AF%E5%92%8C%E8%BF%9C%E7%A8%8B%E5%88%86%E6%94%AF**%0A!%5Bd6dbc7f6e369baecbe2aea3f211c6231.png%5D(en-resource%3A%2F%2Fdatabase%2F2739%3A0)%0A%3E%E7%AC%AC%E4%B8%80%E4%B8%AA%E7%BA%A2%E6%A1%86%E8%A1%A8%E7%A4%BA%E6%98%AF%E6%9C%AC%E5%9C%B0%E7%9A%84%E5%88%86%E6%94%AF%EF%BC%8C%E5%A6%82%E6%9E%9C%E8%A6%81%E5%88%87%E6%8D%A2%E9%9D%9E%E5%BD%93%E5%89%8D%E7%9A%84%E6%9C%AC%E5%9C%B0%E5%88%86%E6%94%AF%EF%BC%8C%E7%9B%B4%E6%8E%A5%E7%82%B9%E5%87%BB%EF%BC%8C%E7%84%B6%E5%90%8E%E9%80%89%E6%8B%A9check%20out%0A%0A!%5B0773094ddd5d4f8994625002764795d2.png%5D(en-resource%3A%2F%2Fdatabase%2F2741%3A0)%0A%0A%3E%20%E7%AC%AC%E4%BA%8C%E4%B8%AA%E7%BA%A2%E6%A1%86%E8%A1%A8%E7%A4%BA%E8%BF%9C%E7%A8%8B%E5%88%86%E6%94%AF%EF%BC%8C%E5%A6%82%E6%9E%9C%E8%A6%81%E5%88%87%E6%8D%A2%E5%BD%93%E5%89%8D%E5%88%86%E6%94%AF%E4%B8%BA%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84%E8%BF%9C%E7%A8%8B%E5%88%86%E6%94%AF%EF%BC%8C%E9%82%A3%E4%B9%88%E7%9B%B4%E6%8E%A5%E7%82%B9%E5%87%BB%EF%BC%8C%E7%84%B6%E5%90%8E%E9%80%89%E6%8B%A9checkout%20As%20...%20%0A%0A!%5B8235b4b94c6ce1d822aeb0ed52216e18.png%5D(en-resource%3A%2F%2Fdatabase%2F2743%3A0)%0A%0A%0A%E5%8F%82%E8%80%83%EF%BC%9A%5Bidea%E5%88%87%E6%8D%A2git%E5%88%86%E6%94%AF%5D(https%3A%2F%2Fwww.jianshu.com%2Fp%2F8a5d6a93c0a8)