I just wrapped up my first week in Intro 1, and Kevin suggested that I share my notes based on some of the questions that I asked. As a beginner to coding, I’m hoping my layman’s notes may help a fellow beginner in the future.
Q: What is Terminal?
A: Terminal is the default macOS command-line interface.
Q: I’m on a Mac. How do I open my Terminal?
A: Go to your Applications folder. Then go to your Utilities folder. The application Terminal is in there. You can also use Spotlight (Command + Space then type Terminal).
Q: What commands were we using in the Terminal this week?
A: We learned some basic Bash and Git commands.
Q: What is Bash? For that matter, what is Git?
A: We use Bash to navigate directories, create or delete files, list folder contents, etc. Examples of Bash commands are:
Q: What Bash commands did we cover the first week?
cd—> go home
cd ~/Desktop/—> go to desktop
mkdir <folder name>—> make directory aka folder
touch <file name>—> create file
ls—> list files in a certain directory
.—> here (your current working directory)
..-> “up a level” (the previous directory)
We also had a brief run-in with a weird text editor called
vim. If you ever find yourself inside of
vim, you can exit by pressing escape and typing
Q: Is there a good resource for more Bash commands?
Q: What is Git?
git is a version control tool that allows you to efficiently track changes that one or more developers might contribute to a the given codebase.
git, we can push our code to a remote repository hosted on GitHub (aka the “cloud” that we send our local Git files to). During our first week, we focused on the following Git commands:
git status—> checks in to see how everything is
git add _file name_--> add your local files to Git’s “staging area”. In layman’s terms, this “staging area” is where you collect all the work you want to
commitbefore pushing it to GitHub
git commit -m “_your message_”--> “Commits” your local files. Think of this as like a “bookmark”, along with a personal note describing what changes you made.
git push origin gh-pages--> “Pushes” your local files. Layman’s terms: you’re sending your local files - in your local copy of the repository - to a remote copy of the repository on GitHub.
Let’s review the order of arguments that
git push accepts:
git push <remote repository> <local branch>
So when we issue
git push origin gh-pages, we’re saying:
gh-pagesbranch to the remote repository - which we’re calling
originsince that’s easier than trying to remember the whole URL of the remote repo”
Q: Is there a good resource for Git commands?
Also, you can find answers to almost every Git question imaginable on Stack Overflow.