emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Proper git settings to stay with master?
@ 2016-12-22 16:44 John Hendy
  2016-12-23 11:24 ` Achim Gratz
  0 siblings, 1 reply; 4+ messages in thread
From: John Hendy @ 2016-12-22 16:44 UTC (permalink / raw)
  To: emacs-orgmode

I've not encountered this issue before, but on a git pull last night I
was greeted with a message like this (I don't have the original which
listed several other branches):

$ git pull
From http://orgmode.org/org-mode
   13751c3249..820d1eb617  maint      -> origin/maint
   7fd61c4f92..1c89082600  master     -> origin/master
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>


I just tried =make up0= and get something similar:

$ make up0
rm -f
git checkout
git remote update
Fetching origin
git pull
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

make: *** [mk/targets.mk:113: up0] Error 1


I don't see anything about this in the FAQ about keeping up to date,
just what I would have done ages ago with a simple =git clone=.[1]

Here's my ~/.elisp/org/.git/config:

$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = http://orgmode.org/org-mode.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master


Have I botched something? If so, what would be the method to remedy?
If not, what should be updated in the instructions regarding sticking
with master? I see references on how to specify maint, but that seems
to imply that master is the default and action is only required to
override to use maint branch.


Thanks,
John

[1] http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development

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

* Re: Proper git settings to stay with master?
  2016-12-22 16:44 Proper git settings to stay with master? John Hendy
@ 2016-12-23 11:24 ` Achim Gratz
  2016-12-23 19:49   ` John Hendy
  0 siblings, 1 reply; 4+ messages in thread
From: Achim Gratz @ 2016-12-23 11:24 UTC (permalink / raw)
  To: emacs-orgmode

Am 22.12.2016 um 17:44 schrieb John Hendy:
> $ git pull
> From http://orgmode.org/org-mode
>    13751c3249..820d1eb617  maint      -> origin/maint
>    7fd61c4f92..1c89082600  master     -> origin/master
> You are not currently on a branch.

Well, then you want to do a

git checkout master

or

git checkout maint

depending on which branch you want to be on.

> Have I botched something? If so, what would be the method to remedy?
> If not, what should be updated in the instructions regarding sticking
> with master? I see references on how to specify maint, but that seems
> to imply that master is the default and action is only required to
> override to use maint branch.

Master _is_ the default, so you must have specifically checked out a 
commit not at the branch HEAD or left a bisect or similar command that 
replays history hanging unfinished somewhere.

-- 
Achim.

(on the road :-)

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

* Re: Proper git settings to stay with master?
  2016-12-23 11:24 ` Achim Gratz
@ 2016-12-23 19:49   ` John Hendy
  2016-12-24 11:15     ` Achim Gratz
  0 siblings, 1 reply; 4+ messages in thread
From: John Hendy @ 2016-12-23 19:49 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

On Fri, Dec 23, 2016 at 5:24 AM, Achim Gratz <Stromeko@nexgo.de> wrote:
> Am 22.12.2016 um 17:44 schrieb John Hendy:
>>
>> $ git pull
>> From http://orgmode.org/org-mode
>>    13751c3249..820d1eb617  maint      -> origin/maint
>>    7fd61c4f92..1c89082600  master     -> origin/master
>> You are not currently on a branch.
>
>
> Well, then you want to do a
>
> git checkout master

Sure... I get that that I *can* do that. I just wondered why I
*needed* to do that.

>
> or
>
> git checkout maint
>
> depending on which branch you want to be on.
>
>> Have I botched something? If so, what would be the method to remedy?
>> If not, what should be updated in the instructions regarding sticking
>> with master? I see references on how to specify maint, but that seems
>> to imply that master is the default and action is only required to
>> override to use maint branch.
>
>
> Master _is_ the default, so you must have specifically checked out a commit
> not at the branch HEAD or left a bisect or similar command that replays
> history hanging unfinished somewhere.
>

This makes sense. I don't know why this never happened before, but
checking out a specific commit makes sense. Perhaps I was bisecting
something in the past and checking out various commits? Once you check
out *something*, do you always have to re-checkout something else to
undo this effect (and make it like the default)? As in if I check out
a commit and then =git pull=, it won't go back to master?


Thanks for clarifying/educating!
John

> --
> Achim.
>
> (on the road :-)
>
>

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

* Re: Proper git settings to stay with master?
  2016-12-23 19:49   ` John Hendy
@ 2016-12-24 11:15     ` Achim Gratz
  0 siblings, 0 replies; 4+ messages in thread
From: Achim Gratz @ 2016-12-24 11:15 UTC (permalink / raw)
  To: emacs-orgmode

Am 23.12.2016 um 20:49 schrieb John Hendy:
> Sure... I get that that I *can* do that. I just wondered why I
> *needed* to do that.

When you are in a "detached HEAD" situation, you will always have to 
tell git explicitly to switch to some other commit (most likely a 
branch).  Git pull works with branch heads, but you've not checked out 
any, so it won't do anything and can't, since it will potentially lose 
data if it tried.

> This makes sense. I don't know why this never happened before, but
> checking out a specific commit makes sense.

Checking out a specific commit not at the branch head, to be precise.

 > Perhaps I was bisecting
> something in the past and checking out various commits? Once you check
> out *something*, do you always have to re-checkout something else to
> undo this effect (and make it like the default)? As in if I check out
> a commit and then =git pull=, it won't go back to master?

Git status tells you where you've currently checked out.


-- 
Achim.

(on the road :-)

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

end of thread, other threads:[~2016-12-24 11:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-22 16:44 Proper git settings to stay with master? John Hendy
2016-12-23 11:24 ` Achim Gratz
2016-12-23 19:49   ` John Hendy
2016-12-24 11:15     ` Achim Gratz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).