Sunday, November 30, 2014

Push changes to a remote repository using Git Bash

Push is the stage where the changes from the local repository get moved to the remote repository, once the changes are committed to the local repository push command will push the changes to the remote repository.

Changes in local working copy -> Stage -> Commit -> Push changes to remote repository

The following steps push the changes from the local repository to the remote repository using Git Bash commands

Committing changes to a local repository using Git Bash

Once the local changes in the working copy are staged/indexed, the next step is to commit the changes to the local repository this will move the changes from staging to the local repository.

Working Copy changes -> Stage/Index -> Commit to Local Repository -> Push to Remote Repository

Use the following steps to commit the changes from stage/index to the local repository

Staging changes using Git Bash

Staging changes using Git Bash 

Once the changes are done in the local working copy, they need to be staged/indexed, this will move the changes to the staging area, from here the changes should be committed to the local repository, and finally be pushed to the remote repository for other users to use the changes. 

Working copy -> Staging -> Commit to Local Repository -> Push to Remote Repository
Use the following steps to stage changes using Git Bash

Cloning a Remote Repository using Git Bash

Cloning a Remote Repository using Git Bash

The clone command can be used to cone a copy of the existing remote repository, alternatively you can also create a new repository all together using the “$ git init” command.

In this post we shall cone an existing repository, which resides in a remote machine. In my case the remote repository is hosted in BitBucket, you can clone any remote repository from the web like BitBucket, GitHub etc or from a local machine in the network.


Use the following steps to clone a remote repository using Git Bash

Getting started with Git GUI

Getting started with Git GUI

Before starting with Git GUI, make sure that you download and install the latest version of Git for Windows.

You can get the installation files from the below URL
Once installed, you can see Git UI & Git Bash added to your programs list as follows.