How can I team up without losing work on github?

I have never cooperated before and now I need to share this project with several others, although I will be involved in 90% of the development.

I have a private repo on github. I clicked my starting source with

git push origin master 

then I created a new local branch and made some changes. Then I did something. (For me, this somehow breaks down.) Now I would like to merge my branch into a master. Locally, he says that both of them are relevant, but on github, it says that my "master" branch has a "3 behind" state.

Some questions in a specific order?

How can I return my valid branch back to the master without losing my job? How should I do this in the future?

+4
source share
1 answer

Step 1. Make sure all your changes are checked.

Step 2:

 git checkout master git merge <your local branch> 

Step 3:

 git push origin master 

And, if you want to continue working on your local branch, complete step 4:

 git checkout <your local branch> 
+15
source

Source: https://habr.com/ru/post/1346061/


All Articles