Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flag/.gacprc setting for creating a branch automatically #129

Open
wmcnamee-coreweave opened this issue Jul 2, 2024 · 0 comments
Open

Comments

@wmcnamee-coreweave
Copy link

I often will get fatal: no upstream configured for branch 'feat/foo' when running gacp. This is easily solved locally as I have an alias and function to solve that:

alias gpsup='git push --set-upstream origin $(git_current_branch)'

git_current_branch () {
	local ref
	ref=$(__git_prompt_git symbolic-ref --quiet HEAD 2> /dev/null)
	local ret=$?
	if [[ $ret != 0 ]]
	then
		[[ $ret == 128 ]] && return
		ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null)  || return
	fi
	echo ${ref#refs/heads/}
}

It would be nice if I could tell gacp to do that for me.

maybe something like --set-upstream origin and in .gacprc it would look like:

{
   "setUpstream": "origin"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant