Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

Change master to main in episode 3 #99

Closed
jt14den opened this issue Jan 27, 2021 · 8 comments
Closed

Change master to main in episode 3 #99

jt14den opened this issue Jan 27, 2021 · 8 comments
Assignees
Labels
status:in progress Contributor working on issue type:bug Code included in the lesson needs to be fixed

Comments

@jt14den
Copy link
Member

jt14den commented Jan 27, 2021

The GitHub default branch is now main not master. However, creating a git repository locally will be by default in a master branch. This creates a problem when we connect the local and remote branch in "Sharing Your Work", Episode 3: https://librarycarpentry.org/lc-git/03-sharing/index.html.

Solution: adopt what GitHub suggests after you create a repository there. This means changing the image in Sharing Your Work from starting with "…or push an existing repository from the command line" under Connecting your local repository to the GitHub repository to the new instructions:

git remote add origin https://github.com/some-librarian/hello-world.git
git branch -M main
git push -u origin main

Possibly include the text of the code rather than the image so it's more copy and pasteable. We also need to then change all references from master to main in the lesson. @scottcpeterson and I are teaching this on 1/29 and can come back with a PR.

@emcaulay
Copy link
Contributor

Thank you @jt14den, @burrowsdt, and @srappel for your work on this. I see that some of the screenshots (or at least one of them) will need updating, too.

The one I noted is: https://github.com/LibraryCarpentry/lc-git/blob/gh-pages/fig/github-instructions.png.

I will leave this issue open until I complete that update.

I am a new maintainer and just getting started so please be patient as I get going.

@doingarchives
Copy link
Contributor

Agreed. These graphics should be named sequentially and stored in a file appended to the course. We should reference this somewhere < https://bit.ly/2VtZ5OX >. If we consistently adopt the bitly links - in a period of time (months) we'll have some alt metrics to help guide future maintenance tasks.

@doingarchives doingarchives added the status:in progress Contributor working on issue label Aug 4, 2021
@emcaulay
Copy link
Contributor

I just took a review of this topic relative to the LC lesson on Git (this lesson). I think we also need changes to Episode 2.

When I used the command git init on my local machine, the default branch was named master. So I would need to define the default branch as main on my machine.

@jt14den do you think I need to update my global git settings? @ErinBecker, can you also help me review this lesson to make sure we are providing instructions that work for new Git users?

@jt14den
Copy link
Member Author

jt14den commented Sep 14, 2021

@emcaulay I still haven't set mine, but recall seeing git suggest that at some point when I taught git last week. If we can do that at the beginning of the lesson when we set global configs, I think that would be good. That said, we'd need to test with GH's instructions after creating a repo on GitHub.

@srappel
Copy link
Contributor

srappel commented Sep 14, 2021

The lc-git workshop seems to have undergone some major changes since my pull request including moving much of the setup off the setup page and into episode 2. But at the very end of the "Setting Up Git" section of episode 2, the command git config --global init.defaultBranch main should set up git globally to initialize new repositories with the default branch name as main.

@ErinBecker
Copy link
Contributor

I worked through episodes 2 and 3, through "Pushing changes". Since episode 2 now includes git config --global init.defaultBranch main as suggested by @srappel, everything worked smoothly for me. I'm not sure when that line was added to episode 2 (tried digging around in the history and don't see it), but it's a great addition and seems to clear up the problem! I think we can close this issue. What do you think @emcaulay?

@srappel
Copy link
Contributor

srappel commented Oct 7, 2021

For what its worth, I think the Library Carpentry version (this repo) handles it better than the Software Carpentry version.

They have a callout about the master/main issue. But they do not actually have the learners set up the default branch name, a mistake in my opinion.

On the next episode, they initialize the repository and then change the default branch to main. I'm not sure why they made this choice despite acknowledging the global setting to the config.

tl;dr: Is it okay if we handle this differently than how Software Carpentry handles it?

@emcaulay
Copy link
Contributor

I think this work has been fully completed.

@srappel, thank you for your query, and we do allow there to be some differences between the Library Carpentry lesson and the Software Carpentry lesson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:in progress Contributor working on issue type:bug Code included in the lesson needs to be fixed
Projects
None yet
Development

No branches or pull requests

5 participants