Git Product home page Git Product logo

Comments (5)

kekoziar avatar kekoziar commented on August 22, 2024

Thank you for the suggestion. That part of the lesson is already in an individual repository. "Next, we will change the default branch to be called main." is in relation to the repository just created, so the default branch is now main in that particular repository. I just tested it in a new repository, and once main is created, an error message is returned if trying to checkout master.

$ git init
Initialized empty Git repository in C:/Users/vlad/repos/test/.git/

vlad@MS-NADF4Y2  ~/repos/test (master)
$ git checkout -b main
Switched to a new branch 'main'

vlad@MS-NADF4Y2 ~/repos/test (main)
$ git checkout master
error: pathspec 'master' did not match any file(s) known to git

do you have a suggestion to make it clearer?

from git-novice.

maneesha avatar maneesha commented on August 22, 2024

The lesson says:

Next, we will change the default branch to be called main.

The instructions in this particular lesson do not do anything to change the name of the default branch. Knowing that the default branch is likely already called main, instead of saying this is something we will do, we could say that we'll check to see what the branch name is, change it if needed, and then continue on.

from git-novice.

kekoziar avatar kekoziar commented on August 22, 2024

Since there are no commits on master, executing git checkout -b main effectively changes the name of the default branch to main. master can no longer be accessed. So, the default branch of the repository is now main (or at least will be once a commit is added - technically at this point the repo doesn't have any branches, and executing git branch -a will return nothing, but this is far beyond a novice lesson).

I appreciate your suggestion to change the text to say we'll check the branch name; feel free to provide example text here if you want to workshop this, or submit a PR.

Also, I recognize that you have elevated privileges in the Carpentries repositories, but please submit PRs from your own forked repo instead of creating new branches in this lesson's repository. Unless there is a new workflow that I'm unaware of? @ErinBecker ??

from git-novice.

martinosorb avatar martinosorb commented on August 22, 2024

There is a proposal in #983 to remove this command from here. The setup suggests to change the default to main, and new git installations should have main as default anyway, so this is unnecessarily confusing for the learners at this stage imho.

from git-novice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.