git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Urgent: Issue with GIT ...
@ 2012-06-25 11:49 guruprasad
  2012-06-25 12:07 ` Konstantin Khomoutov
  2012-06-25 13:02 ` Andy Hawkins
  0 siblings, 2 replies; 10+ messages in thread
From: guruprasad @ 2012-06-25 11:49 UTC (permalink / raw)
  To: git

Hi,

I am Guruprasad from Bangalore, India working for HP. I am very much new to
git and trying to establish a DVCS in my workstation. I am facing few
problems please help me out. below i am giving my setup and the things i
have done till now.

1) I have 2 Linux box (A and B). GIT installed in both of them.
2) I have one project in A and added to GIT repository.
3) Cloned A repository into B. Complete repository got cloned into B from A
along with all source code.
4) If I do some changes to files in A and commit, I am able to pull the
changes done and merge into B. (here i am not doing any push, just pull is
getting all updates)
5) If i do some changes to files in B, commit and push to remote branch, I
am unable to pull the changes done and merge into A. I have set
"receive.denycurrentbranch=ignore" in git config.

Can you please tel me where i am going wrong. Do I need to set anything in
git config?

Once this test is done I need to implement patches over email by using JGIT
in my application, please point me to some nice pointers so that i can
implement it in Java. Please help in this as well.

Quick response is very much appreciated.

Regards,
Guruprasad


--
View this message in context: http://git.661346.n2.nabble.com/Urgent-Issue-with-GIT-tp7562097.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Urgent: Issue with GIT ...
  2012-06-25 11:49 Urgent: Issue with GIT guruprasad
@ 2012-06-25 12:07 ` Konstantin Khomoutov
  2012-06-25 12:55   ` guruprasad
  2012-06-25 13:02 ` Andy Hawkins
  1 sibling, 1 reply; 10+ messages in thread
From: Konstantin Khomoutov @ 2012-06-25 12:07 UTC (permalink / raw)
  To: guruprasad; +Cc: git

On Mon, 25 Jun 2012 04:49:40 -0700 (PDT)
guruprasad <guruprasadkinI@gmail.com> wrote:

First,
http://www.catb.org/~esr/faqs/smart-questions.html#urgent

[...]
> 1) I have 2 Linux box (A and B). GIT installed in both of them.
> 2) I have one project in A and added to GIT repository.
> 3) Cloned A repository into B. Complete repository got cloned into B
> from A along with all source code.
> 4) If I do some changes to files in A and commit, I am able to pull
> the changes done and merge into B. (here i am not doing any push,
> just pull is getting all updates)
> 5) If i do some changes to files in B, commit and push to remote
> branch, I am unable to pull the changes done and merge into A.

What's missing, is the detailed description of how exactly you are
"unable to pull the changes ...".  That is, Git commands you run, the
output they produce.

[...]

P.S.
If you do cross post (you seem to have also posted the same question to
the git-users ML), care to mention this in your mails.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Urgent: Issue with GIT ...
  2012-06-25 12:07 ` Konstantin Khomoutov
@ 2012-06-25 12:55   ` guruprasad
  2012-06-25 13:05     ` jaseem abid
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: guruprasad @ 2012-06-25 12:55 UTC (permalink / raw)
  To: git

Firstly, I apologize for staring subject with "Urgent" and thank you very
much for your time and response.

As i told in my post earlier i am very much new to GIT, I was bit confused
with the tests i went on. I am sorry for not describing it clearly in my
last post. 

1) Pull command is working fine with both the Linux box. Comp A can pull
updates from comp B, vise versa.

2) Push command is not working with both Linux box, command given below.
       git push A master/git push B master

3) When i tried above command first time got an error saying 
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare
repository
remote: error: is denied, because it will make the index and work tree
inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to
match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration
variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing
into
remote: error: its current branch; however, this is not recommended unless
you
remote: error: arranged to update its work tree to match what you pushed in
some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour,
set
remote: error: 'receive.denyCurrentBranch' configuration variable to
'refuse'.
To user@A:/home/user/workspace/TestProject/.git
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to
'user@A:/home/user/workspace/TestProject/.git'

so i added receive.denyCurrentBranch = ignore into git config and tried
again. I dint get any error.

4) But, modified things in files did not get reflected. i tried to push from
A-->B and B-->A. both dint work.
5) Push command i tried after modifying file, staging and committing.

Please let me know if more information is required.

Yes, I posted the same question to the git-users ML. Sorry for not
mentioning it in my post.

Thanks,
Guruprasad


--
View this message in context: http://git.661346.n2.nabble.com/Urgent-Issue-with-GIT-tp7562097p7562100.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Urgent: Issue with GIT ...
  2012-06-25 11:49 Urgent: Issue with GIT guruprasad
  2012-06-25 12:07 ` Konstantin Khomoutov
@ 2012-06-25 13:02 ` Andy Hawkins
  2012-06-26  6:08   ` Kevin
  1 sibling, 1 reply; 10+ messages in thread
From: Andy Hawkins @ 2012-06-25 13:02 UTC (permalink / raw)
  To: git

Hi,

In article <1340624980925-7562097.post@n2.nabble.com>,
           guruprasad<guruprasadkinI@gmail.com> wrote:
> 5) If i do some changes to files in B, commit and push to remote branch, I
> am unable to pull the changes done and merge into A. I have set
> "receive.denycurrentbranch=ignore" in git config.

Sounds like you're trying to push into a remote non-bare repository.

What I'd do is:

1. On 'A', create a bare repository.
2. Somewhere else on 'A', clone this repository. Work and push to the bare
in step 1 when necessary.
3. On 'B', also clone the repository from 1. Work and push to the bare when
necessary.

I don't think it's a good idea to push to a repository that has checked out
files. I seem to remember this being mentioned in Pro Git.

Andy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Urgent: Issue with GIT ...
  2012-06-25 12:55   ` guruprasad
@ 2012-06-25 13:05     ` jaseem abid
  2012-06-25 13:14     ` Angus Hammond
  2012-06-25 13:29     ` Konstantin Khomoutov
  2 siblings, 0 replies; 10+ messages in thread
From: jaseem abid @ 2012-06-25 13:05 UTC (permalink / raw)
  To: guruprasad; +Cc: git

On Mon, Jun 25, 2012 at 6:25 PM, guruprasad <guruprasadkinI@gmail.com> wrote:
> Firstly, I apologize for staring subject with "Urgent" and thank you very
> much for your time and response.
>
> As i told in my post earlier i am very much new to GIT, I was bit confused
> with the tests i went on. I am sorry for not describing it clearly in my
> last post.
>
> 1) Pull command is working fine with both the Linux box. Comp A can pull
> updates from comp B, vise versa.
>
> 2) Push command is not working with both Linux box, command given below.
>       git push A master/git push B master
>
> 3) When i tried above command first time got an error saying
> remote: error: refusing to update checked out branch: refs/heads/master
> remote: error: By default, updating the current branch in a non-bare
> repository
> remote: error: is denied, because it will make the index and work tree
> inconsistent
> remote: error: with what you pushed, and will require 'git reset --hard' to
> match
> remote: error: the work tree to HEAD.
> remote: error:
> remote: error: You can set 'receive.denyCurrentBranch' configuration
> variable to
> remote: error: 'ignore' or 'warn' in the remote repository to allow pushing
> into
> remote: error: its current branch; however, this is not recommended unless
> you
> remote: error: arranged to update its work tree to match what you pushed in
> some
> remote: error: other way.
> remote: error:
> remote: error: To squelch this message and still keep the default behaviour,
> set
> remote: error: 'receive.denyCurrentBranch' configuration variable to
> 'refuse'.
> To user@A:/home/user/workspace/TestProject/.git
>  ! [remote rejected] master -> master (branch is currently checked out)
> error: failed to push some refs to
> 'user@A:/home/user/workspace/TestProject/.git'
>
> so i added receive.denyCurrentBranch = ignore into git config and tried
> again. I dint get any error.
>
> 4) But, modified things in files did not get reflected. i tried to push from
> A-->B and B-->A. both dint work.
> 5) Push command i tried after modifying file, staging and committing.
>
> Please let me know if more information is required.
>
> Yes, I posted the same question to the git-users ML. Sorry for not
> mentioning it in my post.

If you really need a quick answer, hit the #git IRC channel on
freenode. Its a zillion times faster than the mailing list.

-- 
Jaseem Abid
http://jaseemabid.github.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Urgent: Issue with GIT ...
  2012-06-25 12:55   ` guruprasad
  2012-06-25 13:05     ` jaseem abid
@ 2012-06-25 13:14     ` Angus Hammond
  2012-06-25 13:29     ` Konstantin Khomoutov
  2 siblings, 0 replies; 10+ messages in thread
From: Angus Hammond @ 2012-06-25 13:14 UTC (permalink / raw)
  To: guruprasad; +Cc: git

On 25 June 2012 13:55, guruprasad <guruprasadkinI@gmail.com> wrote:
> remote: error: its current branch; however, this is not recommended unless
> you
> remote: error: arranged to update its work tree to match what you pushed in
> some

> 4) But, modified things in files did not get reflected. i tried to push from
> A-->B and B-->A. both dint work.
> 5) Push command i tried after modifying file, staging and committing.
>

I *THINK* the problem you're having is that the push to A updates the
repository itself, but doesn't update the working directory unless you
explicitly tell it to from machine A later on. This is why you got
that horrible long error message when you did the git push, git was
trying to stop you from creating a state where the repository and the
working directory were different.

It seems like the solution would be to checkout master on machine A
after you push, or even better, set up a bare repository somewhere on
one of the systems and arrange for both of the repositories you work
in to push/pull to that one.

Angus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Urgent: Issue with GIT ...
  2012-06-25 12:55   ` guruprasad
  2012-06-25 13:05     ` jaseem abid
  2012-06-25 13:14     ` Angus Hammond
@ 2012-06-25 13:29     ` Konstantin Khomoutov
  2 siblings, 0 replies; 10+ messages in thread
From: Konstantin Khomoutov @ 2012-06-25 13:29 UTC (permalink / raw)
  To: guruprasad; +Cc: git

On Mon, 25 Jun 2012 05:55:25 -0700 (PDT)
guruprasad <guruprasadkinI@gmail.com> wrote:

[...]
> 1) Pull command is working fine with both the Linux box. Comp A can
> pull updates from comp B, vise versa.
> 
> 2) Push command is not working with both Linux box, command given
> below. git push A master/git push B master
> 
> 3) When i tried above command first time got an error saying 
> remote: error: refusing to update checked out branch:
> refs/heads/master remote: error: By default, updating the current
> branch in a non-bare repository
[...]
> so i added receive.denyCurrentBranch = ignore into git config and
> tried again. I dint get any error.
> 
> 4) But, modified things in files did not get reflected. i tried to
> push from A-->B and B-->A. both dint work.
> 5) Push command i tried after modifying file, staging and committing.

This is covered in the Git FAQ [1] -- see the question
«Why won't I see changes in the remote repo after "git push"?»

Supposedly you should either stick to pulling or start using a
"reference" repository (some prefer to call it "central") as already
suggested in [2].  In your case, I don't see why you really need pushes
so I'd stick to pulling.

1. https://git.wiki.kernel.org/index.php/GitFaq
2. http://groups.google.com/group/git-users/msg/5b545f06510c7e2d

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Urgent: Issue with GIT ...
  2012-06-25 13:02 ` Andy Hawkins
@ 2012-06-26  6:08   ` Kevin
  2012-06-26  7:58     ` Andy Hawkins
  0 siblings, 1 reply; 10+ messages in thread
From: Kevin @ 2012-06-26  6:08 UTC (permalink / raw)
  To: Andy Hawkins; +Cc: git

The difference between bare and non-bare repositories is explained here [1].

In this setup, you should only pull from both repositories, not push to the
other repository. If you want to push things, you should use a bare repository
that both repositories can access and push to.

[1]: http://bare-vs-nonbare.gitrecipes.de/



On Mon, Jun 25, 2012 at 3:02 PM, Andy Hawkins <andy@gently.org.uk> wrote:
>
> Hi,
>
> In article <1340624980925-7562097.post@n2.nabble.com>,
>           guruprasad<guruprasadkinI@gmail.com> wrote:
> > 5) If i do some changes to files in B, commit and push to remote branch,
> > I
> > am unable to pull the changes done and merge into A. I have set
> > "receive.denycurrentbranch=ignore" in git config.
>
> Sounds like you're trying to push into a remote non-bare repository.
>
> What I'd do is:
>
> 1. On 'A', create a bare repository.
> 2. Somewhere else on 'A', clone this repository. Work and push to the bare
> in step 1 when necessary.
> 3. On 'B', also clone the repository from 1. Work and push to the bare
> when
> necessary.
>
> I don't think it's a good idea to push to a repository that has checked
> out
> files. I seem to remember this being mentioned in Pro Git.
>
> Andy
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Urgent: Issue with GIT ...
  2012-06-26  6:08   ` Kevin
@ 2012-06-26  7:58     ` Andy Hawkins
  2012-06-26  9:01       ` Kevin
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Hawkins @ 2012-06-26  7:58 UTC (permalink / raw)
  To: git

Hi,

In article <CAO54GHA=R1CyspFrC1n-JLVbm5eE+roXLBv6hFL5M1BHGAcVBA@mail.gmail.com>,
           Kevin<ikke@ikke.info> wrote:
> In this setup, you should only pull from both repositories, not push to the
> other repository. If you want to push things, you should use a bare repository
> that both repositories can access and push to.

Errr, isn't that what I said?

Andy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Urgent: Issue with GIT ...
  2012-06-26  7:58     ` Andy Hawkins
@ 2012-06-26  9:01       ` Kevin
  0 siblings, 0 replies; 10+ messages in thread
From: Kevin @ 2012-06-26  9:01 UTC (permalink / raw)
  To: Andy Hawkins; +Cc: git

Yes, indeed. Read over your reply.

On Tue, Jun 26, 2012 at 9:58 AM, Andy Hawkins <andy@gently.org.uk> wrote:
> Hi,
>
> In article <CAO54GHA=R1CyspFrC1n-JLVbm5eE+roXLBv6hFL5M1BHGAcVBA@mail.gmail.com>,
>           Kevin<ikke@ikke.info> wrote:
>> In this setup, you should only pull from both repositories, not push to the
>> other repository. If you want to push things, you should use a bare repository
>> that both repositories can access and push to.
>
> Errr, isn't that what I said?
>
> Andy
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-06-26  9:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-25 11:49 Urgent: Issue with GIT guruprasad
2012-06-25 12:07 ` Konstantin Khomoutov
2012-06-25 12:55   ` guruprasad
2012-06-25 13:05     ` jaseem abid
2012-06-25 13:14     ` Angus Hammond
2012-06-25 13:29     ` Konstantin Khomoutov
2012-06-25 13:02 ` Andy Hawkins
2012-06-26  6:08   ` Kevin
2012-06-26  7:58     ` Andy Hawkins
2012-06-26  9:01       ` Kevin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).