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