日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

Git命令:常用Git命令集合

發(fā)布時(shí)間:2024/7/5 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Git命令:常用Git命令集合 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.Git基本工作流程

?2.命令

命令作用
git init初始化,創(chuàng)建 git 倉(cāng)庫(kù)
git status查看 git 狀態(tài) (文件是否進(jìn)行了添加、提交操作)
git add 文件名添加,將指定文件添加到暫存區(qū)
git commit -m '提交信息'提交,將暫存區(qū)文件提交到歷史倉(cāng)庫(kù)
git log查看日志( git 提交的歷史日志)

歷史版本切換:

git reflog git reset --hard 版本唯一索引值

?

分支管理操作:

- 創(chuàng)建和切換創(chuàng)建命令:git branch 分支名 切換命令:git checkout 分支名 - 新分支添加文件查看文件命令:ls總結(jié):不同分支之間的關(guān)系是平行的關(guān)系,不會(huì)相互影響 - 合并分支合并命令:git merge 分支名 - 刪除分支刪除命令:git branch -d 分支名 - 查看分支列表查看命令:git branch

遠(yuǎn)程倉(cāng)庫(kù)工作流程(理解)

?

楊路恒@WIN-S5E6V36PP3P MINGW64 /d/Java $ git add 張穎 fatal: not a git repository (or any of the parent directories): .git楊路恒@WIN-S5E6V36PP3P MINGW64 /d/Java $ git init Initialized empty Git repository in D:/Java/.git/楊路恒@WIN-S5E6V36PP3P MINGW64 /d/Java (master) $ git add 張穎 warning: adding embedded git repository: 張穎 hint: You've added another git repository inside your current repository. hint: Clones of the outer repository will not contain the contents of hint: the embedded repository and will not know how to obtain it. hint: If you meant to add a submodule, use: hint: hint: git submodule add <url> 張穎 hint: hint: If you added this path by mistake, you can remove it from the hint: index with: hint: hint: git rm --cached 張穎 hint: hint: See "git help submodule" for more information.楊路恒@WIN-S5E6V36PP3P MINGW64 /d/Java (master) $ git commit -m '張穎' [master d755aaf] 張穎1 file changed, 1 insertion(+)create mode 160000 "\345\274\240\351\242\226"楊路恒@WIN-S5E6V36PP3P MINGW64 /d/Java (master) $ git push -u origin master Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Delta compression using up to 4 threads Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 312 bytes | 312.00 KiB/s, done. Total 2 (delta 0), reused 0 (delta 0) remote: Powered by GITEE.COM [GNK-6.0] To gitee.com:lhyoungxy/zhangying.git73067e1..d755aaf master -> master

從遠(yuǎn)程倉(cāng)庫(kù)復(fù)制到本地倉(cāng)庫(kù):

git clone git@gitee.com:lhyoungxy/zhangying.gitgit pull git@gitee.com:lhyoungxy/zhangying.git

總結(jié)

以上是生活随笔為你收集整理的Git命令:常用Git命令集合的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。