使用git下载仓库_使用Git仓库

使用git下载仓库

Whenever we start a project, we will need to store all files in a repository. So let's start by first creating a repository. We recommend working in a separate, dedicated path for all of your work.

每当我们启动项目时,都需要将所有文件存储在repository 。 因此,让我们首先创建一个存储库。 我们建议您以单独的专用方式进行所有工作。

To create a repository, use the $ git init command. Go on type the following command to create your first repository.

要创建存储库,请使用$ git init命令。 继续键入以下命令来创建您的第一个存储库。

$ git init my_first_repository

You will get a message "Initialized empty Git repository in" and the path of your repository. To check, type in ls and sure enough, there's your first repository.

您将收到一条消息“初始化的空Git存储库位于”以及存储库的路径。 要进行检查,请键入ls并确定,这里是您的第一个存储库。

Go into your repository and type ls.

Hmmm. There's nothing there. Recall that we discussed about hidden files when we talked about the features of a VCS. Let's check out those hidden files by typing in $ ls -a which lists hidden files.

嗯 那里什么都没有。 回想一下我们在讨论VCS的功能时曾讨论过的隐藏文件。 让我们通过输入$ ls -a列出隐藏文件来检查那些隐藏文件

Creating Git Repositories

The .git folder is your local repository and it stores all history and version control information.

.git文件夹是您的本地存储库 ,它存储所有历史记录版本控制信息

But what if you are already working on your awesome project and did not initialize a git repository first. Don't worry. Go to that directory, and type in $ git init without the name of the repository. Git will assume that you need to make a repository for this project directory. If you now type in $ ls, you will see that wonderful little git folder sitting there waiting for you to start working on your awesome project.

但是,如果您已经在进行出色的项目并且没有首先初始化git存储库,该怎么办。 不用担心 转到该目录,然后输入$ git init而不带存储库的名称。 Git将假定您需要为此项目目录创建一个存储库。 如果现在输入$ ls ,您将看到坐在那里的奇妙的小git文件夹等着您开始进行出色的项目。

Renaming Git Repositories

The name of the repository is not as essential as the .git directory inside. Renaming your repository is as simple as using the mv command.

存储库的名称不如内部的.git目录那么重要。 重命名存储库就像使用mv命令一样简单。

$ mv my_first_repository awesome_project

Removing a repository is easy but deadly. Think twice before taking such a step. If you do decide to go ahead and remove your repository, deleting the .git directory will do the job for you.

删除存储库很容易,但是很致命。 采取这样的步骤之前,请三思。 如果您决定继续删除存储库,则删除 .git目录将为您完成此工作。

$ rm -r awesome_project/.git
Deleting Git Repositories

Done. Yes, it's that simple. Now that you know enough about repository let's learn about committing changes to them.

做完了 是的,就是这么简单。 既然您对存储库已经足够了解,那么让我们学习将更改提交到存储库。

翻译自: https://www.studytonight.com/github/repositories-in-git

使用git下载仓库

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值