As a git novice, I understand basics but one thing that I feel uneasy is if my change takes days to complete.
I would start off by creating a new branch branch-A
and work on it but I hear I should get latest code changes from remote on a daily basis, at least once a day to reduce chance of conflicts.
- How often should I get the changes from remote into my
branch-A
while I am actually on that local branch still doing coding? - And if I am on my own local
branch-A
doing coding for days, should I do daily fetch/merge tobrach-A
or to my localmaster
?
UPDATE
I guess I am not clear about what I need clarified.
Assume I use feature branch
Assume medium team size and regardless if we all work in "same" area or not, help me understand what is safe best practice.
Having said that, I do this as this is what I know (not sure what rebase is, as I said I am novice but will read, OK):
Get latest change and merge into develop
git fetch origin
git merge origin/develop
Create new branch from freshly updated develop branch
git checkout -b branch-A
Work and do staging and committing today
git add.
git commit -m "my message"
Next day, I want to make sure I get all changes from remote to reduce chance of conflicts. So, I want to do fetch/merge again but note I am on my branch-A currently
How do I do this? Do I do it like this
git fetch origin
git merge origin/branch-A
or like this
git fetch origin
git merge origin/develop