{"thread":{"id":"21826","subject":"How to update from remote origin with local modified branch?","startedAt":"2009-12-02T11:22:34Z","lastAt":"2009-12-02T16:20:19Z","messageCount":3,"participants":["GittyUser","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"128998","messageId":"1259752954810-4099323.post@n2.nabble.com","threadId":"21826","inReplyTo":null,"subject":"How to update from remote origin with local modified branch?","fromName":"GittyUser","fromEmail":"xtelligence@gmail.com","sentAt":"2009-12-02T11:22:34Z","receivedAt":"2009-12-02T11:22:34Z","isPatch":false,"sender":{"key":"xtelligence@gmail.com","avatar":null},"body":"\nI have once cloned a a project from a remote repository:\ngit cloned http://repo.or.cz/r/openbsc.git\n\nAfter that I modified some files and commited.\nIn the mean time the remote repository had several commits. Now I want to\nupdate my local repo from the remote repo but I also want to keep my own\ncommits. So, when doing \"git pull\" I get the message that certain files\nneeds to be updated.\n\nNow, how can I get my local repo, with my own modification, updated by the\nremote repo?\nI know I need to be aware that those updates (or commits) from remote must\nnot conflict with my local.\n\nThank you.\n-- \nView this message in context: http://n2.nabble.com/How-to-update-from-remote-origin-with-local-modified-branch-tp4099323p4099323.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"129004","messageId":"4B167925.8080307@drmicha.warpmail.net","threadId":"21826","inReplyTo":"1259752954810-4099323.post@n2.nabble.com","subject":"Re: How to update from remote origin with local modified branch?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-12-02T14:26:45Z","receivedAt":"2009-12-02T14:26:45Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"GittyUser venit, vidit, dixit 02.12.2009 12:22:\n> \n> I have once cloned a a project from a remote repository:\n> git cloned http://repo.or.cz/r/openbsc.git\n> \n> After that I modified some files and commited.\n> In the mean time the remote repository had several commits. Now I want to\n> update my local repo from the remote repo but I also want to keep my own\n> commits. So, when doing \"git pull\" I get the message that certain files\n> needs to be updated.\n> \n> Now, how can I get my local repo, with my own modification, updated by the\n> remote repo?\n> I know I need to be aware that those updates (or commits) from remote must\n> not conflict with my local.\n> \n> Thank you.\n\nI think you want to read up on workflows with git and decide whether you\nwant to rebase or merge. In short, git fetch --all (which is called by\ngit pull) will update your remote tracking branches (origin/*), and then\nyou can decide what to do with your local branch (probably master): Do\nyou merge origin/master into master, or do you rebase master onto\norigin/master?\n\nMichael\n"},{"id":"129011","messageId":"1259770819546-4100678.post@n2.nabble.com","threadId":"21826","inReplyTo":"4B167925.8080307@drmicha.warpmail.net","subject":"Re: How to update from remote origin with local modified branch?","fromName":"GittyUser","fromEmail":"xtelligence@gmail.com","sentAt":"2009-12-02T16:20:19Z","receivedAt":"2009-12-02T16:20:19Z","isPatch":false,"sender":{"key":"xtelligence@gmail.com","avatar":null},"body":"\n\nMichael J Gruber-2 wrote:\n> \n> \n> I think you want to read up on workflows with git and decide whether you\n> want to rebase or merge. In short, git fetch --all (which is called by\n> git pull) will update your remote tracking branches (origin/*), and then\n> you can decide what to do with your local branch (probably master): Do\n> you merge origin/master into master, or do you rebase master onto\n> origin/master?\n> \n\nThnx for your response,\n\nWhat I want is merge origin/master to local branch master.  My mistake is to\nhave some uncommited files and I guess that's the reason why it's not,\npardon me, it could not be updated. So I try to commit the files, but still\nhad issues about unmerged files. So as advised I did \"git add -f\nunmergedfile\" and than they were added to the Index. Did finally the commit\nand now get the \"Already up-to-date\" message after a pull command.\n\nStill need to practice a lot to know what is exactly going on.\n\n-- \nView this message in context: http://n2.nabble.com/How-to-update-from-remote-origin-with-local-modified-branch-tp4099323p4100678.html\nSent from the git mailing list archive at Nabble.com.\n"}]}