Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git workflow after commit

Tags:

git

github

I have a local clone of a remote repository with master and branch1.

master was the latest until I did some work on branch1 that I committed (remember, all local). after committing my branch1 work, I’m kind of confused how to go about later steps.

My thinking is to switch to master, and do a git merge branch1, and then do a push of my local copy of master to remote (my local master is up to date with remote master). Is this correct or is there a better way to do this?

like image 653
duxfox-- Avatar asked Dec 04 '25 12:12

duxfox--


1 Answers

It all depends on your workflow. Do you have multiple devs working on the project or just you?

If you are the only developer working on the project, your suggestion is fine. You branch locally, perform your changes, merge, push.

Another approach is to create remote branches, push local to the remote branch, and then merge together (if you are using Stash, BitBucket, or some other remote hosting technology). The latter approach is nice if you are performing collaborative code reviews or need to share your work with a team. You can also push to the remote branch to have a backup.

like image 103
Jordan Parmer Avatar answered Dec 07 '25 02:12

Jordan Parmer