search
Homephp教程PHP开发Detailed explanation of Git tutorial to create a warehouse

Git Create Warehouse

In this chapter we will introduce how to create a Git warehouse.

You can use an existing directory as a Git repository.

git init

Git uses the git init command to initialize a Git warehouse. Many Git commands need to be run in the Git warehouse, so git init uses Git the first command.

After executing the git init command, the Git repository will generate a .git directory, which contains all metadata of the resources, and other project directories remain unchanged (unlike SVN A .svn directory will be generated in each subdirectory, and Git only generates a .git directory in the root directory of the warehouse).

How to use

Use the current directory as the Git repository, we just need to initialize it.

git init

After this command is executed, a .git directory will be generated in the current directory.

Use the directory we specified as the Git repository.

git init newrepo

After initialization, a directory named .git will appear in the newrepo directory. All data and resources required by Git are stored in this directory.

If there are several files in the current directory that you want to put into version control, you need to use the git add command to tell Git to start tracking these files, and then submit:

$ git add *.c
$ git add README
$ git commit -m 'Initialize project version'

The above command will submit the directory ending with .c and the README file to the warehouse.

git clone

We use git clone to copy the project from the existing Git repository (similar to svn checkout).

The command format for cloning a repository is:

git clone

If we need to clone to a specified directory, we can use the following command format:

git clone

Parameter description:

repo: Git warehouse.
directory: local directory.

For example, to clone the Ruby language Git code repository Grit, you can use the following command:

$ git clone git://github.com/schacon/grit.git

After executing this command, a directory named grit will be created in the current directory, which contains a .git directory, used to save all downloaded version records.
If you want to define the name of the new project directory yourself, you can specify the new name at the end of the above command:

$ git clone git://github.com/schacon/grit.git mygrit


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.