{"thread":{"id":"30893","subject":"Urgent: Issue with GIT ...","startedAt":"2012-06-25T11:49:40Z","lastAt":"2012-06-26T09:01:10Z","messageCount":10,"participants":["guruprasad","Konstantin Khomoutov","jaseem abid","Angus Hammond","Andy Hawkins","Kevin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"194203","messageId":"1340624980925-7562097.post@n2.nabble.com","threadId":"30893","inReplyTo":null,"subject":"Urgent: Issue with GIT ...","fromName":"guruprasad","fromEmail":"guruprasadkini@gmail.com","sentAt":"2012-06-25T11:49:40Z","receivedAt":"2012-06-25T11:49:40Z","isPatch":false,"sender":{"key":"guruprasadkini@gmail.com","avatar":null},"body":"Hi,\n\nI am Guruprasad from Bangalore, India working for HP. I am very much new to\ngit and trying to establish a DVCS in my workstation. I am facing few\nproblems please help me out. below i am giving my setup and the things i\nhave done till now.\n\n1) I have 2 Linux box (A and B). GIT installed in both of them.\n2) I have one project in A and added to GIT repository.\n3) Cloned A repository into B. Complete repository got cloned into B from A\nalong with all source code.\n4) If I do some changes to files in A and commit, I am able to pull the\nchanges done and merge into B. (here i am not doing any push, just pull is\ngetting all updates)\n5) If i do some changes to files in B, commit and push to remote branch, I\nam unable to pull the changes done and merge into A. I have set\n\"receive.denycurrentbranch=ignore\" in git config.\n\nCan you please tel me where i am going wrong. Do I need to set anything in\ngit config?\n\nOnce this test is done I need to implement patches over email by using JGIT\nin my application, please point me to some nice pointers so that i can\nimplement it in Java. Please help in this as well.\n\nQuick response is very much appreciated.\n\nRegards,\nGuruprasad\n\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Urgent-Issue-with-GIT-tp7562097.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"194205","messageId":"20120625160734.d8227e5d.kostix@domain007.com","threadId":"30893","inReplyTo":"1340624980925-7562097.post@n2.nabble.com","subject":"Re: Urgent: Issue with GIT ...","fromName":"Konstantin Khomoutov","fromEmail":"flatworm@users.sourceforge.net","sentAt":"2012-06-25T12:07:34Z","receivedAt":"2012-06-25T12:07:34Z","isPatch":false,"sender":{"key":"flatworm@users.sourceforge.net","avatar":null},"body":"On Mon, 25 Jun 2012 04:49:40 -0700 (PDT)\nguruprasad <guruprasadkinI@gmail.com> wrote:\n\nFirst,\nhttp://www.catb.org/~esr/faqs/smart-questions.html#urgent\n\n[...]\n> 1) I have 2 Linux box (A and B). GIT installed in both of them.\n> 2) I have one project in A and added to GIT repository.\n> 3) Cloned A repository into B. Complete repository got cloned into B\n> from A along with all source code.\n> 4) If I do some changes to files in A and commit, I am able to pull\n> the changes done and merge into B. (here i am not doing any push,\n> just pull is getting all updates)\n> 5) If i do some changes to files in B, commit and push to remote\n> branch, I am unable to pull the changes done and merge into A.\n\nWhat's missing, is the detailed description of how exactly you are\n\"unable to pull the changes ...\".  That is, Git commands you run, the\noutput they produce.\n\n[...]\n\nP.S.\nIf you do cross post (you seem to have also posted the same question to\nthe git-users ML), care to mention this in your mails.\n"},{"id":"194206","messageId":"1340628925770-7562100.post@n2.nabble.com","threadId":"30893","inReplyTo":"20120625160734.d8227e5d.kostix@domain007.com","subject":"Re: Urgent: Issue with GIT ...","fromName":"guruprasad","fromEmail":"guruprasadkini@gmail.com","sentAt":"2012-06-25T12:55:25Z","receivedAt":"2012-06-25T12:55:25Z","isPatch":false,"sender":{"key":"guruprasadkini@gmail.com","avatar":null},"body":"Firstly, I apologize for staring subject with \"Urgent\" and thank you very\nmuch for your time and response.\n\nAs i told in my post earlier i am very much new to GIT, I was bit confused\nwith the tests i went on. I am sorry for not describing it clearly in my\nlast post. \n\n1) Pull command is working fine with both the Linux box. Comp A can pull\nupdates from comp B, vise versa.\n\n2) Push command is not working with both Linux box, command given below.\n       git push A master/git push B master\n\n3) When i tried above command first time got an error saying \nremote: error: refusing to update checked out branch: refs/heads/master\nremote: error: By default, updating the current branch in a non-bare\nrepository\nremote: error: is denied, because it will make the index and work tree\ninconsistent\nremote: error: with what you pushed, and will require 'git reset --hard' to\nmatch\nremote: error: the work tree to HEAD.\nremote: error:\nremote: error: You can set 'receive.denyCurrentBranch' configuration\nvariable to\nremote: error: 'ignore' or 'warn' in the remote repository to allow pushing\ninto\nremote: error: its current branch; however, this is not recommended unless\nyou\nremote: error: arranged to update its work tree to match what you pushed in\nsome\nremote: error: other way.\nremote: error:\nremote: error: To squelch this message and still keep the default behaviour,\nset\nremote: error: 'receive.denyCurrentBranch' configuration variable to\n'refuse'.\nTo user@A:/home/user/workspace/TestProject/.git\n ! [remote rejected] master -> master (branch is currently checked out)\nerror: failed to push some refs to\n'user@A:/home/user/workspace/TestProject/.git'\n\nso i added receive.denyCurrentBranch = ignore into git config and tried\nagain. I dint get any error.\n\n4) But, modified things in files did not get reflected. i tried to push from\nA-->B and B-->A. both dint work.\n5) Push command i tried after modifying file, staging and committing.\n\nPlease let me know if more information is required.\n\nYes, I posted the same question to the git-users ML. Sorry for not\nmentioning it in my post.\n\nThanks,\nGuruprasad\n\n\n--\nView this message in context: http://git.661346.n2.nabble.com/Urgent-Issue-with-GIT-tp7562097p7562100.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"194212","messageId":"slrnjugobd.8ie.andy@atom.gently.org.uk","threadId":"30893","inReplyTo":"1340624980925-7562097.post@n2.nabble.com","subject":"Re: Urgent: Issue with GIT ...","fromName":"Andy Hawkins","fromEmail":"andy@gently.org.uk","sentAt":"2012-06-25T13:02:37Z","receivedAt":"2012-06-25T13:02:37Z","isPatch":false,"sender":{"key":"andy@gently.org.uk","avatar":"https://gravatar.com/avatar/bb1d693cf46a3f8239641ec627f5e49b2028cdf9ede886791902cdac058816cd?d=mp&s=160"},"body":"Hi,\n\nIn article <1340624980925-7562097.post@n2.nabble.com>,\n           guruprasad<guruprasadkinI@gmail.com> wrote:\n> 5) If i do some changes to files in B, commit and push to remote branch, I\n> am unable to pull the changes done and merge into A. I have set\n> \"receive.denycurrentbranch=ignore\" in git config.\n\nSounds like you're trying to push into a remote non-bare repository.\n\nWhat I'd do is:\n\n1. On 'A', create a bare repository.\n2. Somewhere else on 'A', clone this repository. Work and push to the bare\nin step 1 when necessary.\n3. On 'B', also clone the repository from 1. Work and push to the bare when\nnecessary.\n\nI don't think it's a good idea to push to a repository that has checked out\nfiles. I seem to remember this being mentioned in Pro Git.\n\nAndy\n"},{"id":"194208","messageId":"CAH-tXsBMtGJyWiWop1n26OWKei-yfojz9X20ZrnPYgru=F0TVg@mail.gmail.com","threadId":"30893","inReplyTo":"1340628925770-7562100.post@n2.nabble.com","subject":"Re: Urgent: Issue with GIT ...","fromName":"jaseem abid","fromEmail":"jaseemabid@gmail.com","sentAt":"2012-06-25T13:05:46Z","receivedAt":"2012-06-25T13:05:46Z","isPatch":false,"sender":{"key":"jaseemabid@gmail.com","avatar":"https://gravatar.com/avatar/8b0432c96e4d3c8a9a96c9961ee842df7b7a869744da9c25187a51a992eabd81?d=mp&s=160"},"body":"On Mon, Jun 25, 2012 at 6:25 PM, guruprasad <guruprasadkinI@gmail.com> wrote:\n> Firstly, I apologize for staring subject with \"Urgent\" and thank you very\n> much for your time and response.\n>\n> As i told in my post earlier i am very much new to GIT, I was bit confused\n> with the tests i went on. I am sorry for not describing it clearly in my\n> last post.\n>\n> 1) Pull command is working fine with both the Linux box. Comp A can pull\n> updates from comp B, vise versa.\n>\n> 2) Push command is not working with both Linux box, command given below.\n>       git push A master/git push B master\n>\n> 3) When i tried above command first time got an error saying\n> remote: error: refusing to update checked out branch: refs/heads/master\n> remote: error: By default, updating the current branch in a non-bare\n> repository\n> remote: error: is denied, because it will make the index and work tree\n> inconsistent\n> remote: error: with what you pushed, and will require 'git reset --hard' to\n> match\n> remote: error: the work tree to HEAD.\n> remote: error:\n> remote: error: You can set 'receive.denyCurrentBranch' configuration\n> variable to\n> remote: error: 'ignore' or 'warn' in the remote repository to allow pushing\n> into\n> remote: error: its current branch; however, this is not recommended unless\n> you\n> remote: error: arranged to update its work tree to match what you pushed in\n> some\n> remote: error: other way.\n> remote: error:\n> remote: error: To squelch this message and still keep the default behaviour,\n> set\n> remote: error: 'receive.denyCurrentBranch' configuration variable to\n> 'refuse'.\n> To user@A:/home/user/workspace/TestProject/.git\n>  ! [remote rejected] master -> master (branch is currently checked out)\n> error: failed to push some refs to\n> 'user@A:/home/user/workspace/TestProject/.git'\n>\n> so i added receive.denyCurrentBranch = ignore into git config and tried\n> again. I dint get any error.\n>\n> 4) But, modified things in files did not get reflected. i tried to push from\n> A-->B and B-->A. both dint work.\n> 5) Push command i tried after modifying file, staging and committing.\n>\n> Please let me know if more information is required.\n>\n> Yes, I posted the same question to the git-users ML. Sorry for not\n> mentioning it in my post.\n\nIf you really need a quick answer, hit the #git IRC channel on\nfreenode. Its a zillion times faster than the mailing list.\n\n-- \nJaseem Abid\nhttp://jaseemabid.github.com\n"},{"id":"194210","messageId":"CAOBOgRb9bMHSmMrj2tw56U_eSYjR+93=9ryE9YOcCsX+mVYeRA@mail.gmail.com","threadId":"30893","inReplyTo":"1340628925770-7562100.post@n2.nabble.com","subject":"Re: Urgent: Issue with GIT ...","fromName":"Angus Hammond","fromEmail":"angusgh@gmail.com","sentAt":"2012-06-25T13:14:32Z","receivedAt":"2012-06-25T13:14:32Z","isPatch":false,"sender":{"key":"angusgh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1839397?v=4"},"body":"On 25 June 2012 13:55, guruprasad <guruprasadkinI@gmail.com> wrote:\n> remote: error: its current branch; however, this is not recommended unless\n> you\n> remote: error: arranged to update its work tree to match what you pushed in\n> some\n\n> 4) But, modified things in files did not get reflected. i tried to push from\n> A-->B and B-->A. both dint work.\n> 5) Push command i tried after modifying file, staging and committing.\n>\n\nI *THINK* the problem you're having is that the push to A updates the\nrepository itself, but doesn't update the working directory unless you\nexplicitly tell it to from machine A later on. This is why you got\nthat horrible long error message when you did the git push, git was\ntrying to stop you from creating a state where the repository and the\nworking directory were different.\n\nIt seems like the solution would be to checkout master on machine A\nafter you push, or even better, set up a bare repository somewhere on\none of the systems and arrange for both of the repositories you work\nin to push/pull to that one.\n\nAngus\n"},{"id":"194211","messageId":"20120625172957.b73effa9.kostix@domain007.com","threadId":"30893","inReplyTo":"1340628925770-7562100.post@n2.nabble.com","subject":"Re: Urgent: Issue with GIT ...","fromName":"Konstantin Khomoutov","fromEmail":"flatworm@users.sourceforge.net","sentAt":"2012-06-25T13:29:57Z","receivedAt":"2012-06-25T13:29:57Z","isPatch":false,"sender":{"key":"flatworm@users.sourceforge.net","avatar":null},"body":"On Mon, 25 Jun 2012 05:55:25 -0700 (PDT)\nguruprasad <guruprasadkinI@gmail.com> wrote:\n\n[...]\n> 1) Pull command is working fine with both the Linux box. Comp A can\n> pull updates from comp B, vise versa.\n> \n> 2) Push command is not working with both Linux box, command given\n> below. git push A master/git push B master\n> \n> 3) When i tried above command first time got an error saying \n> remote: error: refusing to update checked out branch:\n> refs/heads/master remote: error: By default, updating the current\n> branch in a non-bare repository\n[...]\n> so i added receive.denyCurrentBranch = ignore into git config and\n> tried again. I dint get any error.\n> \n> 4) But, modified things in files did not get reflected. i tried to\n> push from A-->B and B-->A. both dint work.\n> 5) Push command i tried after modifying file, staging and committing.\n\nThis is covered in the Git FAQ [1] -- see the question\n«Why won't I see changes in the remote repo after \"git push\"?»\n\nSupposedly you should either stick to pulling or start using a\n\"reference\" repository (some prefer to call it \"central\") as already\nsuggested in [2].  In your case, I don't see why you really need pushes\nso I'd stick to pulling.\n\n1. https://git.wiki.kernel.org/index.php/GitFaq\n2. http://groups.google.com/group/git-users/msg/5b545f06510c7e2d\n"},{"id":"194263","messageId":"CAO54GHA=R1CyspFrC1n-JLVbm5eE+roXLBv6hFL5M1BHGAcVBA@mail.gmail.com","threadId":"30893","inReplyTo":"slrnjugobd.8ie.andy@atom.gently.org.uk","subject":"Re: Urgent: Issue with GIT ...","fromName":"Kevin","fromEmail":"ikke@ikke.info","sentAt":"2012-06-26T06:08:26Z","receivedAt":"2012-06-26T06:08:26Z","isPatch":false,"sender":{"key":"ikke@ikke.info","avatar":"https://gravatar.com/avatar/60a0d08eeccb16914fdbfc7f3441548dc827dc436d5c6900ec6600e274e53c5b?d=mp&s=160"},"body":"The difference between bare and non-bare repositories is explained here [1].\n\nIn this setup, you should only pull from both repositories, not push to the\nother repository. If you want to push things, you should use a bare repository\nthat both repositories can access and push to.\n\n[1]: http://bare-vs-nonbare.gitrecipes.de/\n\n\n\nOn Mon, Jun 25, 2012 at 3:02 PM, Andy Hawkins <andy@gently.org.uk> wrote:\n>\n> Hi,\n>\n> In article <1340624980925-7562097.post@n2.nabble.com>,\n>           guruprasad<guruprasadkinI@gmail.com> wrote:\n> > 5) If i do some changes to files in B, commit and push to remote branch,\n> > I\n> > am unable to pull the changes done and merge into A. I have set\n> > \"receive.denycurrentbranch=ignore\" in git config.\n>\n> Sounds like you're trying to push into a remote non-bare repository.\n>\n> What I'd do is:\n>\n> 1. On 'A', create a bare repository.\n> 2. Somewhere else on 'A', clone this repository. Work and push to the bare\n> in step 1 when necessary.\n> 3. On 'B', also clone the repository from 1. Work and push to the bare\n> when\n> necessary.\n>\n> I don't think it's a good idea to push to a repository that has checked\n> out\n> files. I seem to remember this being mentioned in Pro Git.\n>\n> Andy\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"194266","messageId":"slrnjuiqt9.jhd.andy@atom.gently.org.uk","threadId":"30893","inReplyTo":"CAO54GHA=R1CyspFrC1n-JLVbm5eE+roXLBv6hFL5M1BHGAcVBA@mail.gmail.com","subject":"Re: Urgent: Issue with GIT ...","fromName":"Andy Hawkins","fromEmail":"andy@gently.org.uk","sentAt":"2012-06-26T07:58:33Z","receivedAt":"2012-06-26T07:58:33Z","isPatch":false,"sender":{"key":"andy@gently.org.uk","avatar":"https://gravatar.com/avatar/bb1d693cf46a3f8239641ec627f5e49b2028cdf9ede886791902cdac058816cd?d=mp&s=160"},"body":"Hi,\n\nIn article <CAO54GHA=R1CyspFrC1n-JLVbm5eE+roXLBv6hFL5M1BHGAcVBA@mail.gmail.com>,\n           Kevin<ikke@ikke.info> wrote:\n> In this setup, you should only pull from both repositories, not push to the\n> other repository. If you want to push things, you should use a bare repository\n> that both repositories can access and push to.\n\nErrr, isn't that what I said?\n\nAndy\n"},{"id":"194269","messageId":"CAO54GHBqe9jj1sZtLcRZRhdJJEWwuTesFNgUBSZVnBnNtJvpCQ@mail.gmail.com","threadId":"30893","inReplyTo":"slrnjuiqt9.jhd.andy@atom.gently.org.uk","subject":"Re: Urgent: Issue with GIT ...","fromName":"Kevin","fromEmail":"ikke@ikke.info","sentAt":"2012-06-26T09:01:10Z","receivedAt":"2012-06-26T09:01:10Z","isPatch":false,"sender":{"key":"ikke@ikke.info","avatar":"https://gravatar.com/avatar/60a0d08eeccb16914fdbfc7f3441548dc827dc436d5c6900ec6600e274e53c5b?d=mp&s=160"},"body":"Yes, indeed. Read over your reply.\n\nOn Tue, Jun 26, 2012 at 9:58 AM, Andy Hawkins <andy@gently.org.uk> wrote:\n> Hi,\n>\n> In article <CAO54GHA=R1CyspFrC1n-JLVbm5eE+roXLBv6hFL5M1BHGAcVBA@mail.gmail.com>,\n>           Kevin<ikke@ikke.info> wrote:\n>> In this setup, you should only pull from both repositories, not push to the\n>> other repository. If you want to push things, you should use a bare repository\n>> that both repositories can access and push to.\n>\n> Errr, isn't that what I said?\n>\n> Andy\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}