Git常用操作诠释

首先附上官网链接,供英语不错的朋友之间看
https://git-scm.com/docs

网上发现的不错的文章:
https://www.cnblogs.com/cb0327/p/5066685.html#_label0

下面先写个大概,后面根据实际使用补充
大概介绍下图的几个命令


将文件上传到gitHub所需命令
图片来源于灰太狼博主

Getting and Creating Projects(创建/开始一个项目)

1.git init --Create an empty Git repository or reinitialize an existing one

            创建一个空的git仓库或者重新初始化一个存在的仓库

2.git clone-- Clone a repository into a new directory

            克隆一个仓库到新的目录

Basic Snapshotting(基本快照)

1.git add--Add file contents to the index

         添加文件内容到git缓存区

2.git commit -m "first commit"-Record changes to the repository

      将代码从缓存区提交到本地仓库并加备注

Sharing and Updating Projects(分享/更新项目)

1.git-fetch - Download objects and refs from another repository

从其他仓库下载物体和指向

2.git-remote - Manage set of tracked repositories

  一系列管理仓库的命令

1)git remote add [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=<fetch|push>] <name> <url>
添加一个叫做<name>的远程仓库,链接为url

2.git push - Update remote refs along with associated objects

                        更新远程引用和关联对象
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容