DEV Community

Raymon Schouwenaar for Mr Frontend

Posted on • Originally published at Medium on

17 2

Git 101 — Step 2: add, stage, commit & push

In the previous post I gave a introduction about Git and how to install it. In this video I show you how you can manage your changes, commit them and eventually push them to Github.

Don’t wait any longer! Let’s dive in! 🔥

In order to get your files on Github, we need to add a remote to the local Git repository.

Add remote

You can add a remote by this command.



git remote add origin http://yourGithubURL


Enter fullscreen mode Exit fullscreen mode

In this case is origin the name of the remote. But we can name it whatever we like.

It is even possible to have multiple remotes. Just give it a other name, github or secondremote for example.

Readme file

Every repository needs to have proper README.md file. So you can include all the details to install your project.

The file extention “md” stands for Markdown. Markdown is a minimalistic way of writing and adding styling on a very easy way.

Github has created a guide to tell you everything about Markdown and how to use it.

Check local changes

For example we made some changes to our Git repository. But if we want to see all the changes we have to ask Git for the status. You can do that by this command.



git status


Enter fullscreen mode Exit fullscreen mode

Then git will show you the files that are changed, removed or created. But also the files that are staged or not staged yet.

This example is from another project, but shows you how it looks!

Git status result example
This is a example of the result that git status will return.

Stage files

But after making a change and checking it, we have to prepare the changes, so we can bind it to a commit.



git add .


Enter fullscreen mode Exit fullscreen mode

Is staging all the files.

If we want to do a specific file, we need to use this command.



git add foldername/filename.js


Enter fullscreen mode Exit fullscreen mode

Commit files

No we can finally add a commit message to our files. For that we use:



git commit -m "This is our commit message"


Enter fullscreen mode Exit fullscreen mode

Now all our staged changes are bind to this commit.

Push files to remote master

After doing a commit you can push that commit to the remote repo.

I would recommend it! But it is possible to continue with making changes and making more commits, and in the end push everything. But it’s more safe to do it more often.

To push your changes to the remote repository we have to use this command.



git push origin master


Enter fullscreen mode Exit fullscreen mode

In this case “origin” is the name of our remote and “master” is the default branch where we are working on. Next time I will show you more about branches.

So now all our changes are safe in Github 👍

Do you need help?

I hope this second episode/blog helped you with getting your changes to Github (or any other remote repository). If you need any help, please let me know in the comments! I would ❤️ to help you out!

Originally published at Mr Frontend Blog.


Tiugo image

Modular, Fast, and Built for Developers

CKEditor 5 gives you full control over your editing experience. A modular architecture means you get high performance, fewer re-renders and a setup that scales with your needs.

Start now

Top comments (0)

ACI image

ACI.dev: The Only MCP Server Your AI Agents Need

ACI.dev’s open-source tool-use platform and Unified MCP Server turns 600+ functions into two simple MCP tools on one server—search and execute. Comes with multi-tenant auth and natural-language permission scopes. 100% open-source under Apache 2.0.

Star our GitHub!

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay