1 Setting up git

1.1 Download git

Notes for Windows users. The above download will install Git and Git Bash. Git Bash gives you a linux-like terminal that runs Bash. Git can also be run from Power Shell, but Git Bash would allow you to run every command in this tutorial (e.g., functions such as touch or echo for making file and printing lines in a terminal).

1.2 Configuring git

This user name and email is your identity when using git. Sometimes you don’t want to use a personal email, a no-reply email associated with Github is available for that. For now, just use your personal email.

1.2.2 Setup the correct linebreaks encoding

Different operating systems (OS) uses different characters to encode new lines (linebreaks). Setting git to make sure it reads the correct type of characters as linebreaks.

Mac/Linux

git config --global core.autocrlf input

Windows

git config --global core.autocrlf true

1.2.3 Setup “nano” as the text editor to interface with git

The default text editor for git is Vim, which is difficult to use. nano is a good alternative that can still handle text editing within the terminal. (You could setup other text editors as your default).

1.2.4 Check to ensure settings are correct

## filter.lfs.clean=git-lfs clean -- %f
## filter.lfs.smudge=git-lfs smudge -- %f
## filter.lfs.process=git-lfs filter-process
## filter.lfs.required=true
## user.name=Shady Whale
## user.email=shadywhale@allthewhales.com
## protocol.version=2
## core.editor=nano -w
## core.repositoryformatversion=0
## core.filemode=true
## core.bare=false
## core.logallrefupdates=true
## remote.origin.url=https://github.com/mychan24/git_github_bookdown.git
## remote.origin.fetch=+refs/heads/master:refs/remotes/origin/master
## branch.master.remote=origin
## branch.master.merge=refs/heads/master