Git – Code submission to Master from branch

Objective : I am working on my local branch, I want to push ( submit or check in) my code changes into the remote master (main branch)

Solution 1:
git checkout master git pull #to update the state to the latest remote master state git merge develop #to bring chnages to local master from your develop branch (resolve conflicts if any) git push origin master #push current HEAD to remote master branch
Solution 2:
git pull remote origin/master # to take latest from master to you branch (resolve conflicts if any)
git push remote origin/master # to submit code to remote master

git push remote origin/branch # to submit code to remote branch

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.