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
MuhammedAlaa
MuhammedAlaa2y ago
i.e i changed in header and he changed in footer how can we merge this
Jochem
Jochem2y ago
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
MuhammedAlaa
MuhammedAlaa2y ago
when the other pull it deletes his changes
Jochem
Jochem2y ago
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 pull
MuhammedAlaa
MuhammedAlaa2y ago
can i share screen u ?
Jochem
Jochem2y ago
if you want to post some screenshots that's fine, I don't have time to screen share right now
MuhammedAlaa
MuhammedAlaa2y ago
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
Jochem
Jochem2y ago
have you read the yellow text?
MuhammedAlaa
MuhammedAlaa2y ago
yep i dont know what is rebase and what is the different between rebase.false and rebase.treu true
Jochem
Jochem2y ago
you'll have to either read up on that, or just pick the default and run git config pull.rebase false
MuhammedAlaa
MuhammedAlaa2y ago
if i merge them no changes will be deleted ? he will just put the two changes together mine and the other one
Jochem
Jochem2y ago
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