
We will be working on this file as we learn more about Git. Open the file in your editor and add the following lines to it: # git_started You would typically include information about your project such as setup instructions in this file.
#Git repository tutorial software
Most software used to browse Git repositories visually (by providing a GUI) look for a readme.md file and render the contents on the project’s homepage. Note: Markdown is a lightweight markup language with plain-text-formatting syntax. This will create a file named README with the Markdown extension. Ensure you are still in the git_started directory on your terminal, then run the following command: touch README.md Let’s create the first file that we will be tracking using Git. git is created which contains several files and more subdirectories that Git will use to keep track of changes in the project. Running this command would initialize an empty Git repository in the current directory. To initialize a git repository in this folder, which is now your working directory, run the following command: git init Next, you need to navigate to the newly created directory: cd git_started Initializing the repositoryįirst, create a new directory using the following command: mkdir git_started Let’s see how we can set up a new project using Git. If you run the previous command with a -global flag, your output will only contain configuration settings at the system level. To see all the configurations currently saved on your working directory, run: git config -l You can verify that the commands worked by running the following commands: git config user.email To set up your user name and email, run the following in your command line: git config -global user.email config -global user.name "Educative Learner" The first thing you configure after a successful installation is your email address and username this will identify our contributions and changes in the project source code. System-level: These configurations are placed in the system’s root path it tracks all users and all repos on the operating system.Global-level: this configuration is specific to a user on the operating system the configuration values live in the user’s home directory.By default, git config writes to a local level when no configuration is passed. Local-level: This means that all your credentials and configurations are only limited to your project’s directory.The config command works on different levels: The git config command allows you to set configuration variables that control how git looks and operates. The output should be the current version of Git installed in the system. To confirm that Git has been installed successfully, run this command in your terminal: git -version Once you have git installed, you can then run git commands locally. If you are using a different operating system or Linix distribution, you can find installation instructions on this link.
#Git repository tutorial install
The Git software is a powerful command-line tool that you can install on your machine, whether you use Windows, macOS, or Linux.įor a Debian-based Operating System such as Ubuntu, you can run the following command to install Git in a one-time operation: sudo apt install git-all Tagging allows you to mark important checkpoints in a project’s timeline (i.e. Think of this like a branch that doesn’t change. Tags are a reference to a specific moment in a Git repo’s file history. The git pull command is made up of two commands: git fetch and then git merge. Think of this like you’re merging your version and the original.
#Git repository tutorial update
The git pull command can be used to access and download files from a remote repository and update your local repository so it matches the updates to the original. In general, the original is held on a remote server, like GitHub. You then have your own version of that repo and can start editing it without altering the original. The git clone command is used to target a repository and copy it. This command uses three entities: files, commits, and branches. Think of this as switching between different versions or features of a project. The git checkout command is a way of switching between branches or restores working tree files.

Commit and add are the most popular commands.

Prior to the execution of git commit, we use the git add command to promote any changes that we will later store. Committed snapshots will not change on their own. The commit command captures a snapshot of a project at a particular moment in development.
