• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Code The Dream School
Code the Dream Labs Logo

Code The Dream School

Main hub for class materials for Code the Dream’s classes

  • Code the Dream Home

Search Code The Dream School

Git Recommendations

When you set up git on your machine, there are a couple of configuration options you should use. You can run

git config -l --global

to see if these are set.

You should see:

user.email=<your email address>
user.name=<your github ID>

And perhaps other values. If you do not see these values do:

git config --global user.email <your email address>
git config --global user.name <your github ID>

Recommended Additional Configuration for Windows

You should also make sure git processes line ends correctly on Windows. You should do:

git config --global core.autocrlf input
git config --global core.eol lf

Recommended Git Flow for Code the Dream Class Exercises

  • cd ~/lessons
  • git clone <repository url>
  • cd <directory for the cloned repository>
  • git checkout -b <new branch name>
  • Edit your files as needed for the lesson
  • Save your files
  • Test and modify as necessary
  • git status
  • git add -A
  • git status
  • git commit -m “<some meaningful commit message>”
  • git push origin <new branch name>
  • Go to github for your repository. Create a pull request for your branch
  • Accept/merge the pull request, again on github, to merge into the master branch
  • Go back to your workspace. Close the files in the editor if you haven’t already
  • git checkout master
  • git pull origin master

If you forget and start to do your editing in the master branch, you can do a git stash to store your edited files. That will restore the state of the master branch. You can then create your new branch and do git stash apply to get your edits back.

Remember to close the files in the editor before switching between branches with git checkout, or you may get mixed up.

You could delete the new branch after it is merged with the master, but it is not necessary or recommended to do so for CTD exercises.

Footer

Copyright © 2025 Code the Dream School | All Rights Reserved | Privacy Policy