Have You Seen The New Free Git Commands Quick Guide?

by kleamerkuri
free git commands quick guide

Hi, fellow coders 👋

This is a review post of our new Git Commands With Examples eBook which is a work in progress.

The good news is that you don’t need to be a sitting duck waiting for the eBook release.

You can get started with Git right now by using our quick guide.

Don’t already have our Git Commands Quick Guide? What are you waiting for, get it this instance!

The Git Commands Quick Guide is a truncated version of the soon-to-drop Git Commands With Examples eBook (we’re clearly very creative) and it’s absolutely free for all our lovely subscribers.

Yes, FREE đŸ„

It wasn’t an easy task making a free guide – the thought still makes DM hyperventilate – but I insisted on a Git commands cheat sheet that was more than just a list of Git commands.

Okay, pause
what 😳

What’s a Git commands sheet that’s more than just a list of Git commands?

The Git Commands Quick Guide goes over the most used Git commands.

You know, those of how to do things with Git like add, commit, and push code on a GitHub repo.

But we’re not simply listing the Git commands in a cheat sheet version, like Atlassian’s awesome Git cheat sheet (highly recommend you reference), because knowing what they are is only going to take you so far.

Instead, the Git Commands Quick Guide shows you how to use the most common Git commands with example steps to start doing things at this very moment.

Nice, huh 😁

In the guide, we list the steps of Git commands to

  • . . .download a repo to your local
  • . . .start locally and push remotely
  • . . .merge branches and push to the remote origin
  • . . .add and commit changes

What’s in the Git Commands With Examples eBook?

For those who’d like juicer bits and in-depth explanations of specific steps – including tips, hints, and notes – go for the Git Commands With Examples eBook.

The content of the eBook is literally what I refer to all the time when developing and working on projects.

Git Commands With Examples eBook is perfect for anyone starting with Git because it’ll tell you and show you how to do things while speaking a little about the why behind it. You can use it as a reference when you get stuck or just need additional context.

Most of us don’t need to become Git experts, we only need to work with the darn thing.

I’m committed (catch the pun 😉) to helping us do just that.

TIP

You run Git commands in your machine’s Terminal. Get started with the command line by reading How To Open And Run Commands In The Terminal (Beginner Friendly).

Now, let’s move onto a little glimpse of what to expect from the Git Commands With Examples eBook 🔍

Basic Git commands

git clone

Brings the repo hosted on GitHub into your local folder.

git add

Tracks files and changes (otherwise known as “staging” files).

git commit

Saves files usually with a message that notates what changes were made to the file(s).

git push

Uploads files to a remote repo.

git pull

Downloads changes from a remote repo to your local.

Hint 👀

To check whether you’ve installed Git use git --version

Git Command to Download to Local

git clone [Repo URL]

Downloads a copy of the specified repo in a folder on your computer to work on the files.

Where to find the repo URL

Head over to your GitHub repo and click the Code dropdown where you’ll find the repo URL for cloning that specific repo.

github repo url

How to see cloned repo files

Get a list of all files in a directory by doing two things:

  1. cd [directory] ⇒ move into a specific directory
  2. ls ⇒ list all files and folders in the directory that aren’t hidden

Tip

List everything, including hidden files and directories, using ls --la (the hidden .git folder holds all changes).

Once you’re done working on the files and want to update the repo follow with:

git status

It shows all modified files NOT committed. These are “untracked” files that need to be added.

git add .

Tells Git to track all modified and untracked files.

To be selective on what is added, list the files separated by space.

git add [file 1] [file 2] [etc...]

Adding the files only means Git knows to track changes not save the changes.

Save the changes you made to the files using:

    git commit -m "short descriptive title" -m "optional longer description of changes"

This is equivalent to filling out the following commit fields in the GitHub UI when you’re done editing a file.

github ui commit

Once changes are tracked and saved, you’re ready to push onto the repo.

git push origin master

origin ⇒ refers to the location of the remote repo

master ⇒ name of the branch you’re pushing the changes on the remote repo (this might be called something else for you)

If you get an error by the above command stating no origin is defined, then there’s one more step you need to do.

Check existing remotes with git remote -v.

Add a new remote:

git remote add origin [repo-url]

Edit an existing one:

git remote set-url origin [repo-url]

Related: Click the link for more on when to add origin vs set-url origin.

For errors related to permissions, keep reading 👇

How to connect your local to GitHub

Pushing your changes onto a remote repo won’t happen if you don’t have permissions granting you access to the repo.

You’ll need to connect your local to GitHub by either generating an SSH key or an API token.

To be continued. . .


And that wraps the brief preview of the Git Commands With Examples eBook.

The eBook will be our most comprehensive guide to Git processes so we’re super excited to share it with you as soon as it’s complete.

Mhmmm the anticipation 😉

Related Posts