def METHOD_NAME(self, payload, user, **kwargs):
    user_settings = payload.pop('user_git_settings', dict())
    payload = self.update_user_settings(payload)
    preferences = get_preferences()
    updated_config = dict(preferences.sync_config, **payload)
    # default repo_path to os.getcwd()
    if not updated_config.get('repo_path', None):
        updated_config['repo_path'] = os.getcwd()
    # Update user git settings if they are included
    if user:
        # Validate payloads
        user_payload = self.update_user_settings(user_settings, user=user)
        UserGitConfig.load(config=user_payload)
        repo_path = get_repo_path()
        user_preferences = user.preferences or {}
        user_git_settings = user.git_settings or {}
        user_preferences[repo_path] = {
            **user_preferences.get(repo_path, {}),
            'git_settings': {
                **user_git_settings,
                **user_payload,
            }
        }
        user.refresh()
        user.update(preferences=user_preferences)
    sync_config = GitConfig.load(config=updated_config)
    preferences.update_preferences(dict(sync_config=updated_config))
    GitSync(sync_config)
    return self(get_preferences().sync_config, user, **kwargs)