Development Environment Set Up: Git
Due Friday before class
Objective
to get your development environment set up for future classwork
Part 0: Choose Your Text Editor
You'll use a simple text editor to write Java programs. A text editor is for writing plain text documents, i.e., no different fonts, formats, etc. (We'll use an IDE later.) You will also use a text editor to write your commit messages in git (see below).
These are my takeaways about some possible text editors:
| Text Editor | TL;DRs |
|---|---|
| nano | Command-line, easy interface, after you learn that you call commands using the control key (Ctrl, ^). Works best for small editing tasks, e.g., git commits, but not programming. |
| emacs, vim | It's good to know the basics (e.g., how to save, search, and exit) of one of these text editors at some point because they're often installed on any Linux machine that you will use. They're light-weight and work well over ssh. Gain street cred among old-school developers. |
| Notepad | Good default text editor for Windows. |
| Pulsar | A fork of Atom. Cross-platform. What I use for local (not remote) development. |
| TextMate | For Mac. I haven't used it, but it was recommended by prior students. |
| jEdit | Cool that it's written in Java. It's cross-platform. I used to use it a lot, but I had trouble installing/running it on my new Mac. Better for programming than for commit messages. |
| VSCode | Has extensions that you shouldn't be using/tempted to use
yet. For example, it has GUI interface for git and
includes Copilot.
If you use VSCode, turn
off the AI features. In the linked instructions, make
sure to click the dropdown on the highlighted
Alternatively, one of the embedded tutors suggests this approach:
|
Play around with various text editors to see what you like. The text editor you use for each task
does not need to be the same. For example, while nano is fine for commit messages, I do
not recommend using it for writing code.
Also, keep in mind that you can change the text editor you use at any time.
Part 1: Install and Set Up Git
You'll learn more about git soon, but for now, know that git is a commonly used version control system that we'll use this term.
- If you plan to use only the lab machines, you can skip this
step.
- On Mac or Linux, Git may already be installed.
- Download and install Git
- On Windows, there are some settings you should set to work well with other platforms and it comes with a program called Git Shell that you can use to enter the commands below (you can also install Linux on Windows with WSL!)
- Within your terminal/shell, configure Git for your
computer. Note that these commands only need to be
executed once for each computer you want to use git on.
Replace the information in the commands below as appropriate.
git config --global user.name "YOUR NAME"
git config --global user.email "YOURUSERID@mail.wlu.edu"I will use the terms terminal and shell interchangeably.
- When commiting, git automatically opens an editor to write/save
the commit messages. It seems that most systems are defaulting to
using
vimfor the editor, which many of you probably don't know.vimhas a learning curve, but you definitely can learn it. It is popular with developers, and there are a bunch of tutorials and resources. You can even play a game to learn vim (after consulting the other resources first). If you want to change the editor that is used for git, the template for the command is
git config --global core.editor "'/path/to/executable' -parameters"GitHub provides some examples. Beyond those examples, search the Web for examples for other text editors, e.g., for Pulsar.
Part 2: Creating and Setting Up Your GitHub Account
Create a GitHub account if you don't have one already.
Create Your Personal Access Token (classic)
Create a personal access token (classic) in the GitHub web interface.
- You can set the expiration to be the end of the term or, easier to remember, the end of the year.
- Set the scopes to all of
repo. - Save your token somewhere! You can't retrieve it again after it has been generated. You can create a new one, though.
GitHub is encouraging use of their new fine-grained access tokens, which are more secure. However, they are not supported by all of GitHub's tools yet, and GitHub hasn't made them quite as easy/intuitive to use. We may use these later in the semester, but, for now, let's stick with the classic ones.
Student Developer Pack (Optional)
You may have seen the ad for the Student Developer Pack. Check it out and sign up if you're interested.
Submitting your assignment
No submission. This is just on your honor that you do it, so that you're prepared for future work.