简体   繁体   中英

Auto merge of GitHub branches?

Is there a service I can use to automatically merge the master branch on my GitHub repository to the dev branch every time I commit to it? I don't want to have a script constantly running on my computer, although if that is the only option I can live with it. I would provide more detail, but I don't even know where to start with this.

You want to use git Hooks .

After the entire commit process is completed, the post-commit hook runs.

So try the following:

cd /path/to/project/

echo "#!/bin/sh"                > ./.git/hooks/post-commit
echo "git merge origin/master" >> ./.git/hooks/post-commit

chmod 770 ./.git/hooks/post-commit

The would merge origin/master into your current working branch after each and every commit. You can obviously tweak it accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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