From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: basic git
Date: Sun, 2 Jul 2023 10:25:09 +0700 [thread overview]
Message-ID: <u7qqmn$16sd$1@ciao.gmane.io> (raw)
In-Reply-To: <CAJcAo8veL==vUcmnwQ=QbU6Q7aFFfQ52P6Q1pNALmY6+U+dwTQ@mail.gmail.com>
On 01/07/2023 05:15, Samuel Wales wrote:
> On 6/30/23, Max Nikulin wrote:
>> Do you have history of last git commands, e.g. in an emacs eshell
>> buffer? Please, post them.
It is unclear what was the current branch before (a custom local one,
"bugfix" or "main" tracking the upstream) and whether all local changes
were committed.
> 502 ado git-pullv # says what's new etc.
I have no idea concerning "ado" and "git-pullv". The "git pull" command
should add changes from the tracked remote branch to your local one.
> 503 git branch --set-upstream-to=origin/bugfix bugfix
> #i was told to do this. it worked ok before. but now it tells me i
> have to do something.
This command was necessary just once per local branch when you were
switching from the orgmode.org git repository to savannah. Another use
case is when you want associate a new local branch with a remote one.
> 504 cd $delbig
> 505 cd 9bugfix #symlink
So the commands above and below were executed in unrelated clones.
> 506 git status
> 507 ado git-pullv
> 508 git pull
> 509 git fetch --tags origin #desperation sets in
"git pull" should fetch changes from the remote branch. "git fetch"
obtains changes for all remote branches (remotes/origin/bugfix, etc.)
without touching the local one. So "git fetch" should not break anything.
Perhaps you had a branch that was tracking remotes/origin/main, you
forced to set tracked branch to remotes/origin/bugfix and "git pull"
failed in the process of merging changes from these branches. Usually
the reasonable action is to abort by the command suggested in the "git
status" output to get the state before "git pull".
> 510 git status
> 511 ado git-pullv
> # this is the !@#$ it moment. should work for sure. ha ha.
> 512 git clone https://git.savannah.gnu.org/git/emacs/org-mode.git
> 513 mv org-mode ../new
> 514 cd ..
> 515 mv org-mode--vanilla-bugfix--ok-to-pull--xyzzy-nomost
> ../obsolescent--xyzzy-nomost/
> 516 mv new org-mode--vanilla-bugfix--ok-to-pull--xyzzy-nomost
> 517 cd org-mode--vanilla-bugfix--ok-to-pull--xyzzy-nomost
I am lost whether you are in the directory with the fresh clone. I would
assume it.
> 518 git status
> 519 git gc
Unnecessary in a fresh clone. You may make it impossible recover local
changes if you run it when you are unsure where you are. Will you throw
away garbage when you lost some precious thing and there is a chance
that you put it into the bin with a heap of other stuff?
> 520 git status
> 521 git branch bugfix
This may be a cause of confusion. The default branch of the org
repository is "main" (am I right?) and in the fresh clone you should be
on "main". By this command you created a local branch named "bugfix" but
unrelated to the upstream branch. The current (HEAD) commit of the local
"bugfix" points to the current commit.
> 522 git status
> 523 git branch
> 524 git checkout bugfix
This would be a correct command that creates local "bugfix" tracking
remote "bugfix" unless you executed "git branch bugfix" before. Now you
are on a commit from "main".
> 525 git status
> 526 ado git-pullv
> 527 ado diffoldnew cat .git/config
> 528 git branch --set-upstream-to=origin/bugfix bugfix
I may be wrong with my assumption, but you created local "bugfix"
pointing to a commit from remotes/origin/main and forced it to track
remotes/origin/bugfix. The message from your first post is the plausible
consequence of "git pull" from this state.
If you goal is a clean clone with "bugfix" as the current branch you may do
git clone https://git.savannah.gnu.org/git/emacs/org-mode.git \
org-mode--vanilla-bugfix--ok-to-pull--xyzzy-nomost
cd org-mode--vanilla-bugfix--ok-to-pull--xyzzy-nomost
git checkout bugfix
Do you need to recover commits with your local changes or your are
experimenting with clean upstream "bugfix" and "main" branches?
prev parent reply other threads:[~2023-07-02 3:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAJcAo8tvmam1dErGcM+Dv=+9=YD69XT64epb+NmYuQWFd7ZFRw@mail.gmail.com>
2023-06-30 6:55 ` basic git Samuel Wales
2023-06-30 6:56 ` Samuel Wales
2023-06-30 7:07 ` Dumitru Sipos
2023-06-30 7:20 ` Samuel Wales
2023-06-30 11:58 ` Ihor Radchenko
2023-06-30 10:14 ` Max Nikulin
2023-06-30 22:15 ` Samuel Wales
2023-07-02 3:25 ` Max Nikulin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='u7qqmn$16sd$1@ciao.gmane.io' \
--to=manikulin@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).