For example, this git diff usage identifies the differences in a specific file: git diff file1.txt This command lets you compare changes between your working directory and the most recent commit. ![]() ![]() The basic git log usage lets you view a chronological list of commit history: git log This command displays valuable insights into your files’ modifications and staging status. Use this command to create a commit message for the changes, making them part of your project’s history: git commit -m "Add new feature" This command is used to stage file changes, preparing them for the next commit: git add file1.txt To create a new repository while specifying the project’s name, use the following command: git init Here’s the basic git init usage: git init This command initiates a new Git repository within a directory. Let’s explore some essential Git commands and their functionalities. If you prefer a graphical user interface (GUI) for writing Git commands, consider using one of the best Git GUI clients. Fortunately, this section will guide you through the most frequently used Git commands in the command line interface (CLI) tool. Or sudo dnf install git Most Commonly Used Git Commandsįor some users, Git may have a steep learning curve. If you’re using a Hostinger VPS hosting plan, you can install Git directly to your server by typing one of the commands below depending on your installed OS:įor Debian-based distributions, including Ubuntu: sudo apt install gitįor Fedora-based distributions, such as CentOS: sudo yum install git It is available for Linux or Unix, Windows, and macOS. ![]() Git can be downloaded from its official site. After you commit your modifications, a snapshot of the changes will be saved in the directory. Then, the changes are indexed in the staging area. The working directory is where you add, delete, and edit files. A Git project consists of three major sections: the working directory, the staging area, and the git directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |