Egit: configure rebase as default pull strategy for master branch

佐手、 提交于 2019-12-05 00:02:59

问题


In our new project we've got 10 repositories, each of which have interdependent Eclipse projects.

I plan to establish a default workflow, where each developer is working on the master branch and uses the commit-pull-push cycle. To reduce commits and get a nice linear history I prefer rebase as standard strategy for pull. This works fine, if branch.master.rebase=true is set.

Unfortunatelly it has to be set manually for all repositories, after they are cloned with EGit. I tried setting branch.autosetuprebase=always, but this affects manually created local branches only, not the master branch after a clone.

I would like to automatize the initial setting of branch.master.rebase=true to reduce errors and for convenience. Is there a way to do it? Preferably inside of Eclipse/Egit, but other ideas are welcome, too.


回答1:


As mentioned by Ozan's response to their original question, the correct solution is to add

[branch]
    autosetuprebase=always

in .gitconfig




回答2:


If you want to make this change in the Eclipse GUI

  1. Open the Git Perspective in Eclipse.
  2. Expand your repository, Branches, Local.
  3. Right-click your branch and click "Configure Branch".
  4. Check "Rebase".
  5. Click OK. Do for the rest of the branches pushed to origin.


来源:https://stackoverflow.com/questions/11673901/egit-configure-rebase-as-default-pull-strategy-for-master-branch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!