{"thread":{"id":"26460","subject":"git fetch,git merge and git rebase","startedAt":"2011-02-10T05:29:49Z","lastAt":"2011-02-11T17:13:58Z","messageCount":11,"participants":["Akash","Alexey Shumkin","Jonathan Nieder","Neal Kreitzinger","Jeff King","Felipe Contreras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"160813","messageId":"1297315789338-6010561.post@n2.nabble.com","threadId":"26460","inReplyTo":null,"subject":"git fetch,git merge and git rebase","fromName":"Akash","fromEmail":"bcakashguru@gmail.com","sentAt":"2011-02-10T05:29:49Z","receivedAt":"2011-02-10T05:29:49Z","isPatch":false,"sender":{"key":"bcakashguru@gmail.com","avatar":null},"body":"\nHi,\n\nI am new to git .Can someone explain in simple terms what git fetch,git\nmerge and git rebase do?..I tried googling but was very confused after going\nthro it.\n\nAlso, can someone prescribe a link which explains git in detail right from\nscratch.\n\n\n-- \nView this message in context: http://git.661346.n2.nabble.com/git-fetch-git-merge-and-git-rebase-tp6010561p6010561.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"160814","messageId":"loom.20110210T082201-996@post.gmane.org","threadId":"26460","inReplyTo":"1297315789338-6010561.post@n2.nabble.com","subject":"Re: git fetch,git merge and git rebase","fromName":"Alexey Shumkin","fromEmail":"zapped@mail.ru","sentAt":"2011-02-10T07:22:34Z","receivedAt":"2011-02-10T07:22:34Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"Akash <bcakashguru <at> gmail.com> writes:\n\n> \n> \n> Hi,\n> \n> I am new to git .Can someone explain in simple terms what git fetch,git\n> merge and git rebase do?..I tried googling but was very confused after going\n> thro it.\n> \n> Also, can someone prescribe a link which explains git in detail right from\n> scratch.\n> \n\nRFTM, with all respect ))\nhttp://progit.org/book/\n"},{"id":"160815","messageId":"loom.20110210T082411-967@post.gmane.org","threadId":"26460","inReplyTo":"1297315789338-6010561.post@n2.nabble.com","subject":"Re: git fetch,git merge and git rebase","fromName":"Alexey Shumkin","fromEmail":"zapped@mail.ru","sentAt":"2011-02-10T07:25:01Z","receivedAt":"2011-02-10T07:25:01Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"> I am new to git .Can someone explain in simple terms what git fetch,git\n> merge and git rebase do?..I tried googling but was very confused after going\n> thro it.\n\nand also https://git.wiki.kernel.org/index.php/GitFaq\n"},{"id":"160818","messageId":"20110210082218.GA5997@elie","threadId":"26460","inReplyTo":"loom.20110210T082201-996@post.gmane.org","subject":"Re: git fetch,git merge and git rebase","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-10T08:22:18Z","receivedAt":"2011-02-10T08:22:18Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Alexey Shumkin wrote:\n> Akash writes:\n\n>> I am new to git .Can someone explain in simple terms what git fetch,git\n>> merge and git rebase do?..I tried googling but was very confused after going\n>> thro it.\n>> \n>> Also, can someone prescribe a link which explains git in detail right from\n>> scratch.\n>\n> RFTM, with all respect ))\n> http://progit.org/book/\n\nMore hints:\n\n - \"man git\" (or \"git help git\") has some hints to get started:\n   . a tutorial\n   . a list of \"everyday git\" commands to get going\n   . a short article on centralized, cvs-style workflow\n   . a user's manual\n\n - when anything is unclear in those documents, I will be very happy\n   to learn about it (so cc me in that case :)).  Please be specific\n   as possible about what is confusing.\n\n - people on this mailing list and the #git channel on freenode are\n   generally happy to help if you are trying to do something\n   specific (or have some other specific question).\n\n - there's much material on the web in addition to what's mentioned\n   above.  For example the old git crash course for svn users at\n   http://git.or.cz/course/svn.html taught me a lot about both git and\n   svn.  Theoretically, good material from a variety of sources can\n   gradually flow into the user's manual and reference manual pages,\n   though actual practice does not always match that theory.\n\nGood luck.\n\nKind regards,\nJonathan\n"},{"id":"160835","messageId":"4D5443D1.9000904@gmail.com","threadId":"26460","inReplyTo":"1297315789338-6010561.post@n2.nabble.com","subject":"Re: git fetch,git merge and git rebase","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-02-10T20:00:17Z","receivedAt":"2011-02-10T20:00:17Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 2/9/2011 11:29 PM, Akash wrote:\n>\n> Hi,\n>\n> I am new to git .Can someone explain in simple terms what git fetch,git\n> merge and git rebase do?..I tried googling but was very confused after going\n> thro it.\n>\n> Also, can someone prescribe a link which explains git in detail right from\n> scratch.\n>\n>\ngit fetch:  retrieve the latest version of a branch and store it in the \n/remotes/* \"remote tracking branches\" of your local repo.  you can view \nthese branches with \"git branch -a\".  Once you have that local copy, you \ncan merge it into other branches, checkout objects from it, and run \ndiffs against it.  You are not supposed to EVER make commits on a \nremote/* branch.  its sole purpose in life is to maintain an image the \nthe corresponding branchs that its tracking in the remote repo.  you \nupdate that image by performing git fetch.  see man-page for details.\n\ngit merge:  merges branch(s) into your current branch.  see man-page for \ndetails.  lots and lots of details...\n\ngit rebase:  takes all the local commits you've made on an old history \nand rewrites them on-top of the new history.  it makes it look like you \ndid your work based on the new history instead of the old history.  it \nkeeps your history 'linear' instead of having all these merge DAG's in \nyour history like git-merge produces.  see man page for details.  lots \nand lots of details are not easy to understand at first...\n\nhope this helps.\n\nv/r,\nneal\n"},{"id":"160844","messageId":"4D5464E7.2010407@gmail.com","threadId":"26460","inReplyTo":"1297315789338-6010561.post@n2.nabble.com","subject":"Re: git fetch,git merge and git rebase","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-02-10T22:21:27Z","receivedAt":"2011-02-10T22:21:27Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 2/9/2011 11:29 PM, Akash wrote:\n>\n> Hi,\n>\n> I am new to git .Can someone explain in simple terms what git fetch,git\n> merge and git rebase do?..I tried googling but was very confused after going\n> thro it.\n>\n> Also, can someone prescribe a link which explains git in detail right from\n> scratch.\n>\n>\nanother definition of git-rebase:\n\ngit-rebase:  the MOST DANGEROUS command in git.  you can easily DESTROY \nyour repo if you don't know what you're doing!  Until you get the hang \nof it, always make a copy of the before-image of the branch your \nrebasing (mybranch) by doing a \"git checkout mybranch\" and then \"git \nbranch copy-of-mybranch\".  Then if you destroy mybranch you can recover \nit from copy-of-mybranch.\n\nv/r,\nneal\n"},{"id":"160851","messageId":"20110210230337.GB21335@sigill.intra.peff.net","threadId":"26460","inReplyTo":"4D5464E7.2010407@gmail.com","subject":"Re: git fetch,git merge and git rebase","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-02-10T23:03:38Z","receivedAt":"2011-02-10T23:03:38Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 10, 2011 at 04:21:27PM -0600, Neal Kreitzinger wrote:\n\n> another definition of git-rebase:\n> \n> git-rebase:  the MOST DANGEROUS command in git.  you can easily\n> DESTROY your repo if you don't know what you're doing!  Until you get\n> the hang of it, always make a copy of the before-image of the branch\n> your rebasing (mybranch) by doing a \"git checkout mybranch\" and then\n> \"git branch copy-of-mybranch\".  Then if you destroy mybranch you can\n> recover it from copy-of-mybranch.\n\nI won't claim that rebase isn't easy to shoot yourself in the foot with,\nbut I think this advice is a little over-the-top. Rather than backing up\nbranches, you would do better to learn about reflogs, as the reflog of\nmybranch will contain the original version. As will the reflog of HEAD,\nthough if you have screwed up too badly, the reflog of mybranch will\nprobably be a lot simpler to read.\n\nYou can see it with \"git reflog show mybranch\"; when you see the commit\nthat you want to restore to, you can:\n\n  git branch -f mybranch mybranch@{whatever}\n\nto restore it there. That provides more-or-less the same safety as a\nbackup branch (reflogs do expire, but something like three months\nlater), plus it helps you in all the cases where you forgot to make a\nbackup before screwing things up. :)\n\n-Peff\n"},{"id":"160878","messageId":"1297407554244-6014719.post@n2.nabble.com","threadId":"26460","inReplyTo":"20110210082218.GA5997@elie","subject":"Re: git fetch,git merge and git rebase","fromName":"Akash","fromEmail":"bcakashguru@gmail.com","sentAt":"2011-02-11T06:59:14Z","receivedAt":"2011-02-11T06:59:14Z","isPatch":false,"sender":{"key":"bcakashguru@gmail.com","avatar":null},"body":"\nThanks Jonathan:)\n-- \nView this message in context: http://git.661346.n2.nabble.com/git-fetch-git-merge-and-git-rebase-tp6010561p6014719.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"160879","messageId":"1297407623396-6014723.post@n2.nabble.com","threadId":"26460","inReplyTo":"20110210230337.GB21335@sigill.intra.peff.net","subject":"Re: git fetch,git merge and git rebase","fromName":"Akash","fromEmail":"bcakashguru@gmail.com","sentAt":"2011-02-11T07:00:23Z","receivedAt":"2011-02-11T07:00:23Z","isPatch":false,"sender":{"key":"bcakashguru@gmail.com","avatar":null},"body":"\nThanks Neal:)\n-- \nView this message in context: http://git.661346.n2.nabble.com/git-fetch-git-merge-and-git-rebase-tp6010561p6014723.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"160894","messageId":"AANLkTinsBz0Yi5XXYUcaJMTvkjuhtNjotx0VWRFcKX3d@mail.gmail.com","threadId":"26460","inReplyTo":"4D5464E7.2010407@gmail.com","subject":"Re: git fetch,git merge and git rebase","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2011-02-11T12:32:47Z","receivedAt":"2011-02-11T12:32:47Z","isPatch":false,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Fri, Feb 11, 2011 at 12:21 AM, Neal Kreitzinger\n<nkreitzinger@gmail.com> wrote:\n> On 2/9/2011 11:29 PM, Akash wrote:\n>>\n>> Hi,\n>>\n>> I am new to git .Can someone explain in simple terms what git fetch,git\n>> merge and git rebase do?..I tried googling but was very confused after\n>> going\n>> thro it.\n>>\n>> Also, can someone prescribe a link which explains git in detail right from\n>> scratch.\n>>\n>>\n> another definition of git-rebase:\n>\n> git-rebase:  the MOST DANGEROUS command in git.  you can easily DESTROY your\n> repo if you don't know what you're doing!  Until you get the hang of it,\n> always make a copy of the before-image of the branch your rebasing\n> (mybranch) by doing a \"git checkout mybranch\" and then \"git branch\n> copy-of-mybranch\".  Then if you destroy mybranch you can recover it from\n> copy-of-mybranch.\n\nWhat about 'git rebase --hard', or 'git branch -D'? In all cases you\ncan recover by using the reflog.\n\n-- \nFelipe Contreras\n"},{"id":"160903","messageId":"4D556E56.30702@gmail.com","threadId":"26460","inReplyTo":"AANLkTinsBz0Yi5XXYUcaJMTvkjuhtNjotx0VWRFcKX3d@mail.gmail.com","subject":"Re: git fetch,git merge and git rebase","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-02-11T17:13:58Z","receivedAt":"2011-02-11T17:13:58Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 2/11/2011 6:32 AM, Felipe Contreras wrote:\n> On Fri, Feb 11, 2011 at 12:21 AM, Neal Kreitzinger\n> <nkreitzinger@gmail.com>  wrote:\n>> On 2/9/2011 11:29 PM, Akash wrote:\n>>> Hi,\n>>>\n>>> I am new to git .Can someone explain in simple terms what git fetch,git\n>>> merge and git rebase do?..I tried googling but was very confused after\n>>> going\n>>> thro it.\n>>>\n>>> Also, can someone prescribe a link which explains git in detail right from\n>>> scratch.\n>>>\n>>>\n>> another definition of git-rebase:\n>>\n>> git-rebase:  the MOST DANGEROUS command in git.  you can easily DESTROY your\n>> repo if you don't know what you're doing!  Until you get the hang of it,\n>> always make a copy of the before-image of the branch your rebasing\n>> (mybranch) by doing a \"git checkout mybranch\" and then \"git branch\n>> copy-of-mybranch\".  Then if you destroy mybranch you can recover it from\n>> copy-of-mybranch.\n> What about 'git rebase --hard', or 'git branch -D'? In all cases you\n> can recover by using the reflog.\n>\ni take you meant 'git reset --hard'...\n\nv/r,\nneal\n"}]}