Skip to content

github 常用命令 #2

@fayching

Description

@fayching

Basic commands

以下命令行均需要在命令行工具里面进行

具体更多命令参考:http://blog.csdn.net/ithomer/article/details/7529022

1,clone

用于从github上拷贝项目,
先cd到存放项目到目录,然后运行:

git clone xxx.git

注意:下面命令请cd到项目根目录中进行

2,status

用于查看本地项目有哪些文件被修改

git status

3,add

用于将本地新增的文件、修改的文件、删除的文件做git标记管理

git add -A

4,commit

将3中做好标记到文件提交到本地git版本库中。注意只是提交到本地哦!

git commit -a -m “这个是为啥米提交到信息”

5,push

将4中本地的版本修改更新至github服务器,注意这一步代码会同步至github服务器

git push origin master

6,pull

拉取github服务器最新的代码

git pull origin master

7,log

查看更新日志

git log

git log -p -2

-p 现实更新明细
-2 显示最近两次更新

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions