Git – Delete Branch (Local or Remote)

Normally, when you start working on some new feature, you create a new branch from the default branch (usually called master) and work inside it.

When the work is done – you merge your branch inside master and create a new one to work on the next feature.

Regardless of whether you are working with a local or remote Git repository, it will be a good practice to always remove unnecessary branches to prevent your repository from becoming a garbage. (more…)

Show Git Branch In Terminal – Command Prompt

When you are working inside a Git repository it is important to realize what is the currently checked out Git branch.

You can make it easier to track where you are, by showing the name of the current Git branch in the terminal (command prompt).

In the almost any Linux distribution, including Ubuntu and CentOS, this can be easily done by configuring a primary prompt string, that is controlled via a special shell variable PS1 (more…)

Git – The Basic Workflow

Git is a version control system (VCS) that allows to keep track of the changes made to a project over time.

Git records the changes you make to a project, stores those changes and then allows you to reference them as needed.

From the following article you will learn what does the basic Git workflow consist of and the simple Git commands for everyday use. (more…)

Git – Undo All Uncommitted Changes

Lets say you have been working on a project that is tracked by Git and suddenly realized that you did something wrong.

You have some not yet committed changes and you want to undo everything.

In particular you want to delete all newly created files and folders and restore all modified or deleted.

In short you need to revert all changes back to the last commit. (more…)