repo creation question

9 views
Skip to first unread message

Will Senn

unread,
Dec 3, 2021, 9:31:00 AM12/3/21
to scmmanager
Yesterday I created a new repo to track my work with SICP, a classic CS text. When I did it, I didn't use the same process I normally follow. This time, I followed y'alls hints to "Clone the Repository":
git clone http://loki:8080/scm/repo/git/sicp
cd sicp
git checkout -b main
Then I did some work in the working directory, committed and pushed. Meanwhile over on my laptop, I git clone'd the repo and changed into it, lo and behold, no files... I thought about it and then figured it must be that main branch thing. So, sure enough, I checked out main and there were my files. OK. But, what changed and why? I looked at my other repos and they all just have master until I do something like create a dev or test branch or somesuch. It seems like your hints must've changed. If I:
git clone http://loki:8080/scm/repo/git/sicp
cd sicp
then do some work, commit and push, everything pretty much works as it does in all my existing repos.

My question is, what's with the main branch? Is it a best practice or is this better somehow than just using master? or is it useful in some other specific context? Just curious.

Thanks,

Will



Rene Pfeuffer

unread,
Dec 9, 2021, 4:07:14 AM12/9/21
to scmmanager
Hi Will,

technically there is no difference between `master` or `main`, as long as you have your configurations correct. This is more of a cultural change. You can find a nice summary by GitLab here: https://about.gitlab.com/blog/2021/03/10/new-git-default-branch-name/

It looks like sooner or later the name `main` will get the overall default, so that there should be no more confusion.

Regards
René

Will Senn

unread,
Dec 9, 2021, 9:10:18 AM12/9/21
to scmma...@googlegroups.com
OK. I see. Thanks for the link!

Will
--
You received this message because you are subscribed to the Google Groups "scmmanager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scmmanager+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scmmanager/54c21769-1ba3-461a-bcfc-1f2ab8cfe2f4n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages