How to show Local Git Repository Configuration

This is an article where the purpose of the writing is defined in the title of this article which is informing on how to show local git repository configuration. Showing the configuration of the existing local git repository configuration is very useful. The usage among of the other is retrieving the information of the user which is used to communicate with another say for an example a remote git repository.

Below is the command which can be performed in order to list or to display the git local repository configuration :

Continue reading “How to show Local Git Repository Configuration”

How to Initialize a Local Git Repository

This article is specifically written for a Git section article because the focus of this article is solely on the usage of a Git utility where the main purpose is stated in the title of the article. It is specifying on how to initialize a local Git repository.

There are two scenarios which can be happened in the real situations. It is classified as both using an empty folder or a folder with the content already available. Below are those descriptions :

1. Initializing Local Git Repository in an empty folder :

It starts with creating a new folder named ‘git-folder’ and then the command responsible for initializing it will be executed as follows :

Continue reading “How to Initialize a Local Git Repository”

Git Cheat Sheet Command Page

Initialize an empty repository with either an empty folder or an already filled folder.

git init

Add files or folders to be committed

git add .

Commit files or folders

git commit -m "Commit Message"

Add Git Repository Address

git remote add remote_git_repository_name remote_git_repository_url_address

Continue reading “Git Cheat Sheet Command Page”

How to Solve Error Message fatal: Dirty repository: Having uncommitted changes. Exiting… upon executing git ftp push

This is an error generated upon executing a command of ‘git ftp push’ or ‘git-ftp push’. The command itself is actually a command executed in a CLI-environment or in a Command Line Interface terminal. The command itself is intended to push files and even folders to a Git-based repository such as Gitlab, Gitblit or any other Git-based repository tools.

Based on the manual page, it can be fathomed that it is a Git tool powered by FTP client. This tool is used to push the changes of files or folders in the Git local repository to a Git remote repository which is accessed through an FTP utility. The error can be shown as follows :

user@hostname:~/source-code$ git ftp push
fatal: Dirty repository: Having uncommitted changes. Exiting...
user@hostname:~/source-code$

But before finally pushing the files or folders to a Git-based repository, there are several steps taken before which is shown as follows :

1. Add the modified files or folders in the local Git-based repository.

user@hostname:~/source-code$ git add *

The command above is executed to add modified files or folders’s content to an index in order to be staged for further commit.

2. Commit all the modified files or folders which has already been added in the index of staging phase for further commit. Below is the execution command :

Continue reading “How to Solve Error Message fatal: Dirty repository: Having uncommitted changes. Exiting… upon executing git ftp push”

How to Clone a Git Repository via Command Line with an Example

Another article related to Git function or utility which in this context it is a versioning control. The versioning control in this article is focused on how to clone a Git repository via command line by using an example on how to do it. So, in other words, duplicating or copying a repository which exist locally or remotely can be done by executing the following command provided by Git utility.  In this article, the process itself is done by typing the command in a CLI (Command Line Interface) such as terminal, etc.

At first, before the actual duplicate or copy process can be done, there are several prerequisite which is needed :

1. Install Git utility

2. Check whether the ‘git’ command can be executed. Below is an output example showing the execution of git command :

Continue reading “How to Clone a Git Repository via Command Line with an Example”

All Git Articles

This page is a page which contain all articles about Git Versioning Control and all things related on it :

Tips and Trick

  1. How to Initialize a Local Git Repository .
  2. How to clone or duplicate a Git repository .

Error

  1. How to solve “change not stated for commit” in git commit operation.
  2. How to solve Git push Error Message [remote rejected] master -> master .
  3. How to solve Error Message fatal: Dirty repository: Having uncommitted changes. Exiting… upon executing git ftp push.

 

git commit changes not staged for commit Message

This is an article where the commit process is stumbled upon a message stated as in the title of this article. When performing an operation including moving folders, files and even deleting several folders and files, there are operations which is actually doesn’t included into the staging area in the git commit execution as shown below :

git commit -m "Modifying Folder's Structure"

Below is the execution of the command :

user@hostname:/home/user/source$ git commit -m "Source Modification"
[master 620729e] Source Modification
13 files changed, 11 insertions(+)
create mode 100644 app/Application.php
...
user@hostname:/home/user/source$

After committing the already changed files, push it to the Repository Git :

user@hostname:/home/user/source$ git push --set-upstream application
Username for 'http://app.repository.com': user
Password for 'http://user@app.repository.com':
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 1.28 KiB | 0 bytes/s, done.
Total 6 (delta 1), reused 0 (delta 0)
To http://app.repository.com/gitlab/user/application.git
50e9f83..620729e master -> master
Branch master set up to track remote branch master from application.
user@hostname:/home/user/source$ git-ftp push
fatal: Dirty repository: Having uncommitted changes. Exiting...
user@hostname:/home/user/source$ git-ftp push
fatal: Dirty repository: Having uncommitted changes. Exiting...
user@hostname:/home/user/source$ git commit -m "Source Modification"
On branch master
Your branch is up-to-date with 'application/master'.
Changes not staged for commit:
deleted: resources/views/sidebar.blade.php
deleted: resources/views/test/index.blade.php
deleted: resources/views/test/edit.blade.php
deleted: resources/views/test/show.blade.php
deleted: resources/views/test/update.blade.php

no changes added to commit
user@hostname:/home/user/source$

There are some error message shown in the above output of commit process : “fatal: Dirty repository: Having uncommitted changes.”. The changes which is an addition and modification of folders and files are being processed but not the deletion process. It is also shown in the output above : “Change not stated for commit”, it consist of files which are deleted. So, there are nothing in the staging area which involving the deletion process are being committed.

Continue reading “git commit changes not staged for commit Message”