Skip to content

Instantly share code, notes, and snippets.

@NigelThorne
Created August 28, 2020 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NigelThorne/6ea669035535bd144c5e3354dc211d83 to your computer and use it in GitHub Desktop.
Save NigelThorne/6ea669035535bd144c5e3354dc211d83 to your computer and use it in GitHub Desktop.
AzureDevops Git aliases
[alias]
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
@NigelThorne
Copy link
Author

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