Skip to content

mpenning/makefile_hints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

  • This is a Makefile target to push to main / master...
    • Left-hand tabs are requried... vim can mess that up if you translate tabs to spaces in vim
    • Use ping as a basic internet connectivity test
    • This Makefile captures the main / master branch name
.DEFAULT_GOAL := git-push

.PHONY: git-push
git-push:
	@echo ">> checkout master branch, push to origin/master, switch back to develop"
	ping -q -c1 -W1 4.2.2.2                   # ensure the internet is connected
	-git checkout master || git checkout main # Add dash to ignore checkout fails
	THIS_BRANCH=$(shell git branch --show-current)  # ENV var assignment, no space
	git merge @{-1}                           # merge the previous branch (@{-1})
	git push origin $(THIS_BRANCH)            # push to origin/master...
	git checkout @{-1}                        # checkout the previous branch...

About

Basic Makefile / git development branch example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published