Skip to content

Git操作 #20

Closed
Closed
@Wscats

Description

@Wscats
Owner

git log
查看我们修改过的历史记录
image

git reset --hard commit id
这是回退到某个版本,commit id号可以只是截取开始的一部分
image

dir
查看文件夹目录里面的所有文件

cat
打印某个文件
image

git reflog
查看记录你执行过的每一次命令
image

git checkout
切换到某个分支
image

git status
push前看看修改过了什么文件
image

git branch -d xxxx
删除本地分支,注意在当前这个分支不能删除自己,只能切换到其他分支再删除当前的这个分支
image

git branch -a
查看本地和远程分支
image

git merge xxx
合并xxx分支到当前分支
image

git add [<file>]
添加文件到缓存区,也可以 "git add ." 添加所有文件到缓存
image

git diff [<file>]
比较当前文件和暂存区文件差异
image

git checkout [<file>]
回滚指定文件
image

Activity

MrZhangDQ

MrZhangDQ commented on Oct 26, 2016

@MrZhangDQ

看不够的感觉,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Wscats@MrZhangDQ

        Issue actions

          Git操作 · Issue #20 · Wscats/articles