2017-06-09 9 views
1

変更の負荷をコミットできますが、何もgithubにはなりません。変更をコミットすると、VScodeが自動プッシュされません

私が手動で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, 

答えて

1

this issueによるとGitHubの上では、この機能は存在しないと追加される予定はありません。

この動作を実現するには、Git hooksを使用することをお勧めします。このような

何か:

#!/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 

あなたはより多くの詳細とオプションについてthis answerを確認することができます。

関連する問題