First Commit for a Git Noob

Brian Nelson
Brian Nelson
Published in
3 min readDec 16, 2020

--

After being lightly involved in coding for several years, I recently had my first introduction to the the world of Git. After watching tutorials and reading articles I wanted to distill some very simple Git information learned by a complete noob.

Photo by James Harrison on Unsplash

What you need to have/know already

  1. A GitHub account (or similar)
  2. A bash style terminal (Allows you to use git terminal commands)
  3. Git downloaded and installed
  4. An existing project folder
git init

This initializes or creates the file(repository) that you will eventually “Push” or upload to your Github. To do this you have to make sure you are in the right file directory, and in the root of what you want to push.

git add .

Adds all your files that to a sort of staging area (there are ways around this but here it is for sake of learning)

git commit -m 'a comment about what feature you worked on'

“git commit” is what actually saves your changes to the git repository (that extra file that we created when we used git init)

Make a new repository

Once you have your changes committed, make yourself a new repository on GitHub if you don’t already have one.

Name the repository, and create it. Make sure you name it something that makes sense to you and other people.

Grab the repo url and add it to your Git project

git remote add origin https://github.com/Lazer-lad/new-repository-name.git

Now that your repository has a place to go we can push it there.

git push -u origin master

If you look in your repository on GitHub you will see your files uploaded to GitHub.

Conclusion

Obviously this is very basic and there is much more in depth learning to be done to master git and the Different industry practices used. However steps like this helped me get my first Git commits up to GitHub.

Brian Nelson is a student in the Digital Media program at Utah Valley University, Orem Utah, studying Web & App Development. The following article relates to a project that involved setting up git and using github in the DGM 2760 Course and representative of the skills learned.

--

--