Git实操记录

爱被打了一巴掌 2022-11-01 10:57 277阅读 0赞

配置

$ git config —global user.name “[name]“

$ git config —global user.email “[email address]“

$ git config —global color.ui auto

创建仓库

$ git init [project-name]

$ git clone [url]

更改

$ git status

$ git diff

$ git add [file]

$ git diff —staged

$ git reset [file]

$ git commit -m “[descriptive message]“

分支

$ git branch

$ git branch [branch-name]

$ git checkout [branch-name]

$ git merge [branch]

$ git branch -d [branch-name]

重构文件名

$ git rm [file]

$ git rm —cached [file]

$ git mv [file-original] [file-renamed]

浏览历史

$ git log

$ git log —follow [file]

$ git diff [first-branch]…[second-branch]

$ git show [commit]

抑制跟踪

*.log build/ temp-*

$ git ls-files —other —ignored —exclude-standard

保存片段

$ git stash

$ git stash pop

$ git stash list

$ git stash drop

重新提交

$ git reset [commit]

$ git reset —hard [commit]

同步更改

$ git fetch [bookmark]

$ git merge [bookmark]/[branch]

$ git push [alias] [branch]

$ git pull

参考文件

帮助文档

Github 简明教程

Git五分钟教程

发表评论

表情:
评论列表 (有 0 条评论,277人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Redux

    一、实现在首页传入数据 1.src项目文件夹下面,有home、types、reducers、action文件夹,home下有一个Home.js,需要在这个js文件开头引入