Open Source Articles

Page 122 of 123

How to ignore a previously committed file in Git repository?

kannan sudhakaran
kannan sudhakaran
Updated on 20-Feb-2021 5K+ Views

The .gitignore file does not operate on files that are already committed. To ignore changes to a file that was accidentally staged or committed the following should be done −Step 1 − Remove such files or directories from the staging areaStep 2 − Commit changes in the repositoryStep 3 − Add path of such files or directories in the .gitignore fileStep 4 − Commit changes to the repositoryLet us understand this with an example −Create a folder by the name “bin” in the working directory. Add a file “temp.bin” with some content inside the folder and commit the changes.$ mkdir ...

Read More

What is the purpose of the .gitignore file?

kannan sudhakaran
kannan sudhakaran
Updated on 20-Feb-2021 2K+ Views

When a Git project is compiled it may generate binary files, lock files, temporary files and metadata files. These are intermediate files that are not part of the source code. For example, IDE config files or intermediate files like “.class”, ”.exe”, “.bin” etc. that are generated during compilation should be ignored by the version control system as they will be different for each developer machine and will unnecessarily increase the size of the repository.The .gitignore is a text file where each line contains a pattern for files or directories to ignore. It is usually placed at the root of the ...

Read More

How to remove a committed file from the Git repository?

kannan sudhakaran
kannan sudhakaran
Updated on 20-Feb-2021 1K+ Views

Git allows you to delete a file from the repository using any of the following methods −Using the Linux rm commandUsing the git rm commandScenario 1 − Use the Linux rm commandThe syntax of the Linux rm command is −$ git rm Let us assume that a file “file1.python” exists in the repository. Use the Linux rm command to delete the file − “file1.python”.$ git rm file1.pythonLet us first verify if the file has been removed from the working directory. This can be verified by using the Linux ls command.$ lsThe output suggests that the file has been removed from ...

Read More

What are the steps to rename a file in Git?

kannan sudhakaran
kannan sudhakaran
Updated on 20-Feb-2021 4K+ Views

A file can be renamed in the following two ways −Use the mv Linux commandUse the git mv commandScenario 1 − Use the Linux mv commandThe following example assumes that a file “file1.txt” exists in the repository. The syntax for using the Linux mv command is −$ mv Use the Linux command mv to rename the file to “file1.java”.$ mv file1.txt file1.javaExecute the git status command to verify the file’s status in Git.$ git statusThe output in the screenshot suggests that the file has been renamed in two steps −“file1.txt” has been deleted from the working areaA new file ...

Read More

Why should you use git add command before using git commit command?

kannan sudhakaran
kannan sudhakaran
Updated on 20-Feb-2021 5K+ Views

The git add command adds files to the staging area whereas the git commit command will write changes to the repository permanently.When you have completed an important feature, you will need to create a snapshot of that change and save it to the Git repository. To achieve this, you will perform a commit.In Git, there exists an intermediate step before commit which does not exist in other version control systems. This intermediate step is called a staging area. The staging area is also known as the index. The staging area can be used to build up a set of changes ...

Read More

How do you handle End-of-Line characters in Git on Windows / Linux / Mac Operating Systems?

kannan sudhakaran
kannan sudhakaran
Updated on 20-Feb-2021 3K+ Views

This question can also be rephrased as − How do you resolve the Git warning − "LF will be replaced by CRLF"?The End−of−Line is marked using two special characters "\r" in Windows Operating System while the “" character is used to mark End-of-Line in MacOS and Linux systems.The \r and are known as the Carriage Return (CR) and Line Feed (LF) characters respectively. It is important to handle End-of-Line characters properly for consistency across multiple Operating Systems.End−of−Line characters can be configured in two ways −At the time of installation −At the time of installation, Git allows us to select from ...

Read More

What is .git folder and why is it hidden?

kannan sudhakaran
kannan sudhakaran
Updated on 20-Feb-2021 22K+ Views

Git is currently the most popular version control system. A version control system records the changes made to our project codebase in a special kind of file system-based database. In Git, this database is known as a repository and its structure is inspired by the Linux file system. The repository maintains a history of the changes to our codebase.The .git folder contains all information that is necessary for the project and all information relating commits, remote repository address, etc. It also contains a log that stores the commit history. This log can help you to roll back to the desired ...

Read More

Red Hat Updates OpenShift Container Platform with New Service Catalog

karthikeya Boyini
karthikeya Boyini
Updated on 23-Jan-2020 225 Views

Red Hat, an American multinational software company, recently released an update of its OpenShift container platform on August 9. This update provides users with capacities which are taken from open-source Kubernetes 1.6 release. This is Red Hat’s quarterly update of the OpenShift platform. This update brings in a lot of changes but the major one is an addition of a Service Catalog which will help IT or third-party vendors in creating connections to internal or external services.This shows that in recent years, OpenShift has mainly become a Red Hat distribution of Kubernetes. The OpenShift is largely responsible for providing enterprise-grade ...

Read More

How To Configure and Setup Ghost on Ubuntu 16.04

Sharon Christine
Sharon Christine
Updated on 23-Jan-2020 419 Views

In this article, we will learn how to setup and Configure Ghost on Ubuntu 16.04. Ghost os a light-weight and open-source blogging programs which can be used easily and can be customizable, also have many more themes to use.Pre-RequisitesIn this setup, we need the following –Ubuntu 16.04 installed server machine.A non-root user with Sudo permissions on the machine.Nginx web server installed on the server.Ghost Installation on Ubuntu 16.04We will install the ghost using the Ghosts official repository which is hosted on GitHub.First, we will get the latest version of the Ghost using the bellow command.$ wget https://ghost.org/zip/ghost-latest.zip Output:    --2017-05-18 ...

Read More

How to Kill a Process by Name in Linux?

Sharon Christine
Sharon Christine
Updated on 22-Jan-2020 776 Views

This article shows you how to use the Linux pkill command to kill running processes within Linux by using a name. Pkill (see pgrep) is a command-line utility while Solaris 7 process is running. pkill works on a currently active running process and lists down process ID’s which matches with the criteria.To kill a process by name in Linux, use the following command –pkillTo get a list of process in Linux, use the following command –$ ps -AThe sample output should be like this –PID TTY          TIME CMD    1 ?           ...

Read More
Showing 1211–1220 of 1,225 articles
Advertisements