概述列表-最常用的git命令 [英] overview list - most used git commands

查看:59
本文介绍了概述列表-最常用的git命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人列出最常用的git命令?不是完整的手册,而是我每天大约需要的东西.我是新手,想在屏幕下放一个小清单.这样可以更快地获取git.

Does anyone has a short list with most used git commands? Not the complete manual, but only what I approximately need daily. I'm new and would like a small list to put under my screen. This to pickup git faster.

这就是所有人!

推荐答案

这是我想到的.我已经把它打印出来了,它可以帮助我开始使用git命令:

This is what I came up with. I have printed this out, and it helps me getting started with git commands:

git init
git status
git log --summary

git add file.txt
git add '*.txt'     : add all files, also in subfolders
git rm file.txt     : remove file
git rm -r foldername: remove file and folders recursively

git commit -m "Descriptive text of the change"

git remote add origin https://github.com/try-git/try_git.git
git push -u origin master
git pull origin master
git diff --staged

git add folder/file.txt         : Add file to staged area
git reset folder/file.txt       : Remove file from staged area
git checkout -- folder/file.txt : checkout the last know version, restore.
git branch feature      : create branch
git checkout feature    : use branch (and do the work)
git checkout master     : go back to master before merge
git merge feature       : merge branch into master
git branch -d feature   : delete that branch that is not used any more

这篇关于概述列表-最常用的git命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆