emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: basic git


From: Max Nikulin
Subject: Re: basic git
Date: Sun, 2 Jul 2023 10:25:09 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]