Want to create interactive content? It’s easy in Genially!

Get started free

How to use github from your terminal to create a branch, and push updates

Deniz Timurturkan

Created on March 17, 2025

Start designing with a free template

Discover more than 1500 professional designs like these:

Modern Presentation

Terrazzo Presentation

Colorful Presentation

Modular Structure Presentation

Chromatic Presentation

City Presentation

News Presentation

Transcript

How to use github from your terminal to create a branch, and push updates

Deniz Timurturkan

What is Github? GitHub is a web-based platform that uses Git, a distributed version control system, to allow developers to store, share, and collaborate on code projects. It provides tools for managing code changes, tracking issues, and managing software projects.

What are some core Github lines prior to creating a branch?

Step 2 Starting a Repository

Step 4 Staging & Committing

Step 5 Pushing & Pulling

Step 3 Branching

Step 1 Setup & Configuration

1) Setup & Configuration

git config --global user.name "Your Name"Sets your name in Git so it appears in commit history. git config --global user.email "youremail@example.com" Links your email to your Git commits. These lines are essential prior to anything you want to achieve through your terminal for access. Only needed once per machine.

2) Starting a Repository

git init -> Initializes a new Git repository in the current directory. This creates a .git folder, which tracks all changes.git clone <repo-url> -> Creates a copy of an existing repository from a remote (e.g., GitHub). Example: git clone https://github.com/user/repo.git

3) Branching & Merging

git branch ->Lists all branches in the repository. The current branch is marked with *. git branch <branch-name> -> Creates a new branch but does not switch to it. After you create a branch, you can use git checkout <name> to switch to that branch. Ex: git checkout main

git merge <branch-name> -> Merging takes the changes from one branch and applies them to another. Happens when you've finished working on a feature and want to bring those changes into the main branch.

git checkout -b <branch-name> -> Creates and switches to the specified branch. You can use git checkout for now as we are simply wanting to create a new branch and work on it.

4) Staging & Committing

git status -> Shows the current state of your working directory. It tells you which files are modified, staged, or untracked. Not required for a change but very helpful for checking. git add <file> -> Stages a specific file for commit. Example: git add project.zip git add . -> Stages all changed files for commit. Call this before committing. git commit -m "Your commit message" Saves the staged changes with a message describing the update. Example: git commit -m "Fixed a bug in the login page"

Branch completed!

Congratulations! At this point, you've already finished creating a new branch, and learned how to add and commit your files into it. This next step will teach you how to push and pull your changes, as well as seeing the changes done to it by your peers.

5) Pushing & Pulling

git pull origin <branch> -> Fetches and integrates changes from the remote repository into your local branch. Example: git pull origin main -> updates your local main branch. git push origin <branch> -> Uploads your local commits to the remote repository. Example: git push origin main -> pushes the main branch to GitHub.

Branches

Pull Requests

Repositories

Code

Push Requests

Github

Hosting

Commits

Issues

Versioning

Security

Collaboration

Workflow

Now that you've learned how to use github, let's do a quick quiz!

Question 1/5
Question 2/5
Question 3/5
Question 4/5
Question 5/5

Here's a quick crashcourse of Git about what it is, what it's used for, and how to effectively use it.