More common git commands at work

Source: Internet
Author: User
Tags git commands

git config core.filemode false git ignores file permissions

git-View Remote repository information
git remote show origin

        git拉取远程分支到本地        git checkout origin/remoteName -b localName
        git查看提交的文件名称记录        git log --name-only
        git 显示短的校验和,并与提交描述显示在同一行。        git log --oneline
        git log - -author=CnPeng 就会展示出CnPeng这个用户的修改历史 。注意:这里的用户名,是初始化git 时传入的name .        git log --author=用户名
        以相对当前的时间展示提交历史        git log --relative-date
 git stash: 备份当前的工作区的内容,从最近的一次提交中读取相关内容,让工作区保证和上次提交的内容一致。同时,将当前的工作区内容保存到Git栈中。 git stash pop: 从Git栈中读取最近一次保存的内容,恢复工作区的相关内容。由于可能存在多个Stash的内容,所以用栈来管理,pop会从最近的一个stash中读取内容并恢复。 git stash list: 显示Git栈内的所有备份,可以利用这个列表来决定从那个地方恢复。 git stash clear: 清空Git栈。此时使用gitg等图形化工具会发现,原来stash的哪些节点都消失了。

How git revokes the merge operation
git reset--hard "The version number before the merge"

Server Public Key Configuration
/home/git/.ssh/authorized_keysgit Master is newer than the remote master
git remote update Origingit Master is newer than the Master Update
Git Remote update Origin branch comparison
git log master ^graygit tips: Git blame && git show See the revision history of a line of code

Diff can directly compare two files

More common git commands at work

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.