Skip to content
Snippets Groups Projects
Select Git revision
  • 56f174e768b25966a3bc1678f6ea659b6913b0b1
  • master default protected
  • 0.5.9
  • 0.5.8
  • 0.5.7
  • 0.5.6
  • 0.5.5
  • 0.5.4
  • 0.5.3
  • 0.5.2
  • 0.5.1
  • 0.5.0
  • 0.4.17
  • 0.4.16
  • 0.4.15
  • 0.4.14
  • 0.4.13
  • 0.4.12
  • 0.4.11
  • 0.4.10
  • 0.4.9
  • 0.4.8
22 results

target-git.mk

Blame
  • Volker Schukai's avatar
    31731b28
    History
    target-git.mk 2.04 KiB
    #############################################################################################
    #############################################################################################
    ##
    ## GIT-TARGETS
    ##
    #############################################################################################
    #############################################################################################
    
    ifeq ($(GIT),)
      $(error $(ERRORMARKER) Git is not defined, check your Makefile if git.mk is included)
    endif
    
    ## Current Branch-GIT_TAG
    GIT_TAG := -
    
    ## Git Commit GIT_MESSAGE for git-push
    GIT_MESSAGE := current status
    
    .PHONY: git-branch
    ## create new branch (use GIT_TAG-Variable)
    git-branch:
    	$(QUIET) export BRANCH="b$(GIT_TAG)/$(shell uuidgen --random)" ; \
    	$(QUIET) $(GIT) checkout -b $${BRANCH} && \
    	RESULT=$$($(GIT) push origin $$BRANCH 2>&1) && \
        RESULT2=$$($(GIT) branch --set-upstream-to=origin/$$BRANCH $$BRANCH) && \
    	GITLABURL=$$(echo "$$RESULT" | tr '\n' '\#' | grep -o 'remote\:\s*https:\/\/gitlab\.schukai\.com[^ ]*' | cut -d " " -f2-9 | sed -e 's/^[ \t]*//') && \
    	if $(OPENBROWSER) ; then google-chrome --profile-directory="Default" $$GITLABURL ; fi
    
    .PHONY: git-to-master
    ## git checkout master, fetch and merge
    git-to-master:
    	$(QUIET) $(GIT) checkout master && $(GIT) fetch -pP && $(GIT) merge
    
    .PHONY: git-push-to-server
    ## git push changes to server
    git-push-to-server:
    	$(QUIET) $(GIT) add -A
    	$(QUIET) $(GIT) commit -m"$(GIT_MESSAGE)"
    	$(QUIET) $(GIT) push
    
    .PHONY: git-push
    ## git create branch and push changes to server
    git-push: git-branch git-push-to-server
    
    .PHONY: git-tag
    ## git create version tag
    git-tag:
    	$(QUIET) $(GIT) tag -a "$(COMPONENT_VERSION)" -m "release $(COMPONENT_VERSION)"
    
    .PHONY: git-prune-remote
    ## removes your local remote tracking branches where the branch no longer exists on the remote
    git-prune-remote:
    	$(QUIET) $(GIT) remote prune origin
    
    .PHONY: git-prune-local
    ## deletes local merged branches except the master branch
    git-prune-local:
    	$(QUIET) $(GIT) branch --merged master | grep -v '^[ *]*master$$' | xargs git branch -d