我可以提交大量的更改,但是github什么也得不到。
只有当我手动单击它推送到github的菜单中的PUSH函数时,才会这样做。
当我提交时,我如何让它自动完成这个任务?
这些是我的VS GIT设置:
// Whether git is enabled
"git.enabled": true,
// Path to the git executable
"git.path": null,
// Whether auto refreshing is enabled
"git.autorefresh": true,
// Whether auto fetching is enabled
"git.autofetch": true,
// Confirm before synchronizing git repositories
"git.confirmSync": true,
// Controls the git badge counter. `all` counts all changes. `tracked` counts only the tracked changes. `off` turns it off.
"git.countBadge": "all",
// Controls what type of branches are listed when running `Checkout to...`. `all` shows all refs, `local` shows only the local branchs, `tags` shows only tags and `remote` shows only remote branches.
"git.checkoutType": "all",
// Ignores the legacy Git warning
"git.ignoreLegacyWarning": false,
// Ignores the warning when there are too many changes in a repository
"git.ignoreLimitWarning": false,
// The default location where to clone a git repository
"git.defaultCloneDirectory": null,
// Commit all changes when there are not staged changes.
"git.enableSmartCommit": false,
发布于 2017-07-04 14:48:58
根据本期 on GitHub的说法,这个特性不存在,也不打算添加。
他们建议使用吉特钩来实现这种行为。
就像这样:
#!/usr/bin/env bash
branch_name=`git symbolic-ref --short HEAD`
retcode=$?
# Only push if branch_name was found (my be empty if in detached head state)
if [ $retcode = 0 ] ; then
#Only push if branch_name is master
if [[ $branch_name = "master" ]] ; then
echo
echo "**** Pushing current branch $branch_name to origin ****"
echo
git push origin $branch_name;
fi
fi
您可以查看这个答案获得更多详细信息和选项。
https://stackoverflow.com/questions/44453939
复制相似问题