Commit Files or Folders to Git Repository

Posted on

This is an article which is written with the main description is going to discuss and explain on how to commit files or folders to a Git repository. Based on the previous article which is tightly related about how to add files or folders to a Git repository where the link is shown in this link. The title of the article itself is ‘Add Files or Folders to Git Repository‘ and it is mainly informs on how to add or to be more precise to select the files or folders which is going to be added to the index files of the Git local repository for further operation, for an instance to be operated for commit operation so the changes of the already added file can be processed on the Git local repository.

So, how can a files or folders which has been added can also be committed ?. The answer is similar with the one written in the article for adding files or folders in a Git repository. It can be specified as follows :

1. Install Git package or utility. Depends on the operating system where the local Git repository for the folder is going to be associate or initialize located, the installation process can go through many different methods.

2. After successfully installing git utility, just associate or initialize the folder where files or folders are going to be processed to be synchronize to a remote Git repository. Read the article titled ‘Setup a Git Repository via Command Line‘ in this link to find out.

3. Add the files or folders which is located inside the folder which has already been associate or initialize with Git version control stated in the 2nd step. It can be found in the article titled ‘Add Files or Folders to Git Repository‘ in this link.

4. After successfully executing the previous step, just commit the files or folders by executing the following command :

git commit -m "comment or information about the commit process..."

For an example :

user@hostname:~/test$ git commit -m "Adding Uncommitted Files ..."
[master 76ddede] Adding Uncommitted Files ...
42 files changed, 0 insertions(+), 0 deletions(-)
rewrite Document/Installation Manual-31-03-2017.xlsx (93%)
create mode 100644 Document/Installation Manual-25-04-2017.xlsx
create mode 100644 Document/Installation Manual-edited-07072017.xlsx
create mode 100644 Document/Installation Manual-edited-12072017.xlsx
create mode 100644 Document/Installation Manual-edited-13072017.xlsx
create mode 100644 Document/README_2017.xlsx
create mode 100644 Document/User-Guide-edited-12072017.xlsx
delete mode 100644 Document/System-Specification/system-specification-31032017-final.docx
delete mode 100644 Document/User-Requirement/process-implementation-drill.docx
rename Document/UAT/UAT.docx.docx => Dokumen/UAT/UAT-05-12-2016.docx} (100%)
create mode 100644 Document/Implementation/Deployment-Plan.zip
create mode 100644 Document/Implementation/Deployment-Schema.pdf
rename Document/MoM/2017/{ => Old}/MoM-07022017.docx (100%)
rename Document/Implementation/Application-Configuration-14032016.docx => Document/Implementation/Application-Configuration-Final-14032016.docx} (100%)
rename Document/SLA/{2016 => Document/SLA}/SLA-2016.docx (100%)
create mode 100644 Document/SLA/2017/Old/User-Agreement-14032016.docx
rename Document/SLA/{2016 => Document/SLA}/SLA-2016-1405206.docx (100%)
create mode 100644 Document/SLA/2017/Old/Downtime-Status-14052016.docx
rename Document/SLA/{2016 => 2017/Old}/PIC.docx (100%)
user@hostname:~/test$

The above is the output generated after performing commit process. But to be exact and precise, the process only committing to the local Git repository. To push it to remote Git repository server, there is another process which is needed to be done.

One thought on “Commit Files or Folders to Git Repository

Leave a Reply