From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id a1ySFlvuoGQxcQEASxT56A (envelope-from ) for ; Sun, 02 Jul 2023 05:26:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id QFzaFVvuoGRNHgEA9RJhRA (envelope-from ) for ; Sun, 02 Jul 2023 05:26:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CF3AE16327 for ; Sun, 2 Jul 2023 05:26:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFniI-0006dI-AX; Sat, 01 Jul 2023 23:25:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFniG-0006d9-Me for emacs-orgmode@gnu.org; Sat, 01 Jul 2023 23:25:24 -0400 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFniF-0004Vc-0e for emacs-orgmode@gnu.org; Sat, 01 Jul 2023 23:25:24 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1qFniA-000AaM-JJ for emacs-orgmode@gnu.org; Sun, 02 Jul 2023 05:25:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: basic git Date: Sun, 2 Jul 2023 10:25:09 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 27 X-Spam_score: 2.7 X-Spam_bar: ++ X-Spam_report: (2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.093, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1688268379; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=twaG5iSBXGaADwPomU5TN7Ad2QyrdIpq4oWsGAdEDls=; b=ZJ6lhJc2b+C3ZoixKfQq2ZeW1Msm5TQwI3m5zXyOSlzcxNSz4iIwp7OZ5DK/DI0dCyIIgb U8GEZCiRCUsRrx3DbXnibA7uy+qAanMpj+4lHlBf4f1do/6Os+7r2LDkuXPr70CNUibDYQ f6tF7fr/h5NdxFuJd0hHFUNP4akKB1KmfbF2diHf8CokOLqWtFmqZky1sAOt/KbCu/hkiO uNB/lRBkuRmc5AdpuMt+s25CgTXanuUCBR+53+dFJTamI4LHsuBN+O/DLqWWeIj+yjdDO0 S3cvF1EYDJuZBU5W+TWTEDunxSLdQ8GzGIa/gVEcA8fzXmUxz71Yk0r539HBOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1688268379; a=rsa-sha256; cv=none; b=dC5rWdQV11f+kSQ15N8SujpfxMecx6EzjgA12GByUcGJixOipA8eSYKE4eDOqEcOoEi/Q8 HlcfT5CqXZhyxPRIabnkv2MUH2b6T3x+47RKcz37YRZQkJdnBfyaA/CaokMG1P76kKN0Vb LuGwV1BgSKtFzyWzUhHnJkdL83a9oM/OEh4CCg/aSl6roTaYnxYVMDDYvy8ksP+WPf+NTe +18Q+zDsOZ5+O9AGyXNZPZ9nYHGgRbDDLv8+NCaZIeP8Z0QpPRROwo8Cx+++/UfCPMBllR 4clmAd/tqFgnjzpzHkw9TZoERs7jChBMHYfY8JzoG6ije5E8e4OKr0Wyx+dyxg== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.95 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CF3AE16327 X-Spam-Score: -0.95 X-TUID: HmIzxyMrLgnS 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?