This is where I will be setting up scripts which will hopefully automate the set-up of my dev environment in the future.
Unfortunately this part cannot be automated yet (or at least I haven't found out a way to automate it yet). Thankfully it's pretty easy.
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
You will then need to copy/paste the key into your github account.
The following two links were where I learned how to set-up my keys and then add them to my Github account:
- https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
- https://help.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account
Then you need to configure your local Github username and password.
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Everything else should be automated.
For a variety of reasons, it seems appropriate to change the "master" branch to the "main" branch. Thankfully this is very easy to do. You can even create a new branch based off of master through the Github interface. You will need to run git pull
to pull in the new branch if you created it through Github.
Once you've made your new main
branch the default branch, you can delete the old master
branch.
- To delete the branch locally run,
git branch -d master
. - To delete the branch on Github, run
git push origin --delete master
. - To reset HEAD,
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
. See here for more details. - To delete stale branches,
git remote prune origin
. See here for more details.