Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
AzureDevops Git aliases
pushu = !git push --set-upstream origin `git symbolic-ref --short HEAD` && git rpr
current-branch-name = !git rev-parse --abbrev-ref HEAD
current-branch-name-escaped = !git escape-url `git current-branch-name`
escape-url = "!f() { perl -MURI::Escape -e \"print uri_escape('"$*"');\"; }; f"
current-push-url = !git remote get-url --push origin
raise-pull-request = !sh -c \"echo -e \\\" \\nRaise a pull request here: \\n `git current-push-url`/pullrequestcreate?sourceRef=`git current-branch-name-escaped`&targetRef=master\\\"\"
rpr = raise-pull-request
Copy link

NigelThorne commented Aug 28, 2020

git pushu
sets upstream to follow local branch name and pushes changes to server.
Then generates and displays url for azuredevops to raise a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment