创建仓库

git init

在当前目录执行,会生成.git目录文件,这个和SVN一致。

提交到仓库

git commit -m "first commit"

-m:表示提交描述,必须要填。

添加到远端仓库

git remote add origin git@github.com:test/test.git

推送到远端仓库

git push -u origin master

克隆仓库

直接从远端把代码克隆下来。

git clone git@github.com:test/test.git

仓库状态

git status
$ git status
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        README.md

nothing added to commit but untracked files present (use "git add" to track)

仓库更新

git pull

就等同下面。

git fetch
git merge
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注