Last active
February 5, 2023 07:51
-
-
Save back-2-95/e23d1f9e1450d6b45e0ca190edfb986e to your computer and use it in GitHub Desktop.
How to sync to other git repository in different system (Azure example)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIT_REMOTE_AZURE := azure | |
GIT_REMOTE_AZURE_URL := REPO_IN_AZURE | |
GIT_REMOTE_AZURE_BRANCH := dev | |
GIT_REMOTE_AZURE_PUSH_BRANCH := dev-github | |
PHONY += git-add-remote | |
git-add-remote: ## Add Azure Git remote | |
$(call step,Add Azure Git remote...) | |
git remote add $(GIT_REMOTE_AZURE) $(GIT_REMOTE_AZURE_URL) | |
PHONY += git-show-remote | |
git-show-remote: ## Show all Git remotes | |
$(call step,Show all Git remotes...) | |
@git remote -v | |
PHONY += git-pull-from-azure | |
git-pull-from-azure: ## Git pull from Azure | |
$(call step,Git pull from Azure...) | |
git pull $(GIT_REMOTE_AZURE) $(GIT_REMOTE_AZURE_BRANCH) | |
PHONY += git-push-to-azure | |
git-push-to-azure: ## Git push to Azure | |
$(call step,Git push to Azure...) | |
git push $(GIT_REMOTE_AZURE) $(shell git rev-parse --abbrev-ref HEAD):$(shell git rev-parse --abbrev-ref HEAD)-github |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment