Github
if iam working with some one on a project on github and i did some changes in a part if a page and he did on another part how can we we merge this changes without overwriting one change on the other
12 Replies
i.e i changed in header and he changed in footer how can we merge this
one of you commits and pushes your changes to github, then the other pulls changes from github
git should merge the changes if they don't touch the same lines, but if there's a conflict or git gets confused, the person pulling changes will get a warning that there are merge conflicts, which they can then resolve
when the other pull it deletes his changes
with a conflict, git produces a file that has markers (usually
>>>>>>>
and <<<<<<<<<
) about what changes were added by each of the people committing, and then you have to use your own human meat brain to figure out how those changes work together
it shouldn't
he could commit without pushing, but that shouldn't be necessary unless you're using all kinds of force
type flags on the pullcan i share screen u ?
if you want to post some screenshots that's fine, I don't have time to screen share right now
my local file is not the same of the file on github i commited mine and iam trying to pull the one on the git hub
have you read the yellow text?
yep i dont know what is rebase and what is the different between rebase.false and rebase.treu
true
you'll have to either read up on that, or just pick the default and run
git config pull.rebase false
if i merge them no changes will be deleted ?
he will just put the two changes together mine and the other one
it should work once you have that config option set, but if you're worried make a copy of your changes to a different folder and then run pull