Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on setting up a Git repo exercise – Clarification needed #32

Closed
sfoteini opened this issue Oct 29, 2022 · 0 comments
Closed

Issue on setting up a Git repo exercise – Clarification needed #32

sfoteini opened this issue Oct 29, 2022 · 0 comments
Labels
GitHub Bug Bash Feedback logged during GitHub Bug Bash triaged This issue is currently being worked on

Comments

@sfoteini
Copy link

Describe the bug

Issue on Introduction to Git: Exercise - Try out Git

In the section “Set up your Git repository”, in step 3 and for Git version 2.28.0 or later: It seems that both git init --initial-branch=main and git init -b main commands initialize a new repository and set the name of the default branch to main. So, the user should use only one of these commands.

To Reproduce

Steps to reproduce the behavior:

  1. In Cloud Shell, type git –version to check the GitHub version. (Git version used when reporting this issue: 2.33.4)
  2. Define user’s name and email using
    git config --global user.name "<USER_NAME>"
    git config --global user.email "<USER_EMAIL>"
    
  3. Create a folder named Cats.
    mkdir Cats
    
  4. Change to the project directory.
    cd Cats
    
  5. If you're running Git version 2.28.0 or later, use the following commands to initialize your new repository and set the name of the default branch to main.
    git init --initial-branch=main
    git init -b main
    
  6. See the output in cloud shell.

Expected behavior

It seems that the user can use either git init --initial-branch=main or git init -b main to initialize their new repo and set the name of the default branch to main.

Based on Git documentation, these two commands are equivalent.
If you use git init --initial-branch=main (or git init -b main) and then git status, you get the following output in cloud shell.

Initialized empty Git repository in /home/<user>/Cats/.git/
On branch main
No commits yet
nothing to commit (create/copy files and use "git add" to track)

(I am a beginner in Git, but it seems that the repo is initialized correctly.)

Screenshots

Output if you use both commands:
issue1

Output if you use only one of the above commands (expected output):
issue2

Based on this issue, the content can be modified as follows.
issue3

There is also a mistake in the name of the branch in the next step of the instructions (Step 4). The current branch is named main and not master. The instructions should be modified as follows.
Issue:
issue4

Expected:
issue5

Desktop (please complete the following information):

  • OS: Any
  • Browser: Any
  • Version: Any

Smartphone (please complete the following information):

  • Device: Any
  • OS: Any
  • Browser: Any
  • Version: Any

🎓 Add a tag to this issue for your current education role: student, Student Ambassador or educator.


student, Student Ambassador

@alischumacher alischumacher added the GitHub Bug Bash Feedback logged during GitHub Bug Bash label Nov 3, 2022
@alischumacher alischumacher added the triaged This issue is currently being worked on label Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GitHub Bug Bash Feedback logged during GitHub Bug Bash triaged This issue is currently being worked on
Projects
None yet
Development

No branches or pull requests

2 participants