Git, Doubt when I commit

7

I have a question about using git, and I would like the help of you.

I have the following situation:

  • I'm developing a new feature in my application, but I did not complete it completely. Let's assume that I'm developing on the pc at home. Then I go to work, and resolve, at lunch, to continue the new feature.

Follow my doubt ... The application stays in Github. I developed on the home pc, and I commandei unfinished to finish at lunch time at work ...

What is the solution to not eating incomplete things in git?

Thank you in advance!

    
asked by anonymous 18.10.2017 / 04:52

1 answer

6

Create a branch where you have this new feature. When it is ready it merge with master .

git checkout master
# criar novo ramo a partir do master
git checkout -b nova-ideia

And then at work:

git fetch origin # ou outro nome que deste ao repositório remoto
git checkout nova-ideia (sem o "-b" que é para criar novo)
    
18.10.2017 / 06:40