> On Fri, Apr 14, 2023 at 04:38:34PM +0200, Uwe Brauer wrote:

> Well, your approach is incorrect. ;-)
> A correct one is going to be quicker, too.

> As I've explained in this list in the past, _by default_ Git implements
> asymmetric approach to handling remote repositories and branches they
> contain - you might want to re-read [1] and may be the whole thread; may be
> this idea will now have greater chances to really sink in as you will be
> able to compare and contrast "normal" clone and "mirror" clone.

You are right, I am sorry. You dedicated quite some time, but it seemed  so
overwhelming  that I just kept this bit of information in my memory:

I wrote 
|  git branch -a
| * main
|   remotes/origin/HEAD -> origin/main
|   remotes/origin/feature
|   remotes/origin/main

And you final answer was
|   git checkout feature

I admit I even forgot that had an extended thread on the topic. That
your answer cannot be the last word on this issue I realized yesterday.
Suppose I have to remotes 


|  git branch -a
| * master
|   remotes/bitbucket/HEAD -> bitbucket/main
|   remotes/bitbucket/feature
|   remotes/bitbucket/master


 git checkout feature 

Can not be the answer. 

But I think it is better before you even answer, that I go over the
thread and try to sort it out for myself (as far as I can get).

Because I need to understand that structure if I want deal with
pull-requests and fork (via the command line and emacs without magit).
For sure tomorrow after some testing I will run into other problems, and
will send another message. 

>  1. Clone the original repo:

>       git clone --mirror o...@git.code.sf.net/p/matlab-emacs/src

That worked as I expected (as a mercurial user)
I just followed the instructions of the gitlab documentation but did not
realize that this instructions were aimed as users you have set up their
own local repository but not a mirror.

>     Note that a bare repository is created. That means, it has no work tree
>     (no checked out files).

>     You can now `cd` to the resulting directory and do `git branch` (note
>     the absense of "-a" or "-r") and `git tag` there to see that all the
>     branches and all the tags are here.

>  2. Configure a named remote in your clone:

>       git remote add gitlab --mirror=push 
> g...@gitlab.com:kalthad/matlab-emacs.git

Thanks, I for sure would have used.

git remote add gitlab  g...@gitlab.com:kalthad/matlab-emacs.git

Without the mirror option.

Thanks again for you patience.


Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to