溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

六、Github的使用(2)

發(fā)布時(shí)間:2020-07-13 02:53:14 來源:網(wǎng)絡(luò) 閱讀:351 作者:少年不在了 欄目:開發(fā)技術(shù)

34、同時(shí)變更了文件名和文件內(nèi)容如何處理
當(dāng)遠(yuǎn)端倉庫與本地的文件名不一致時(shí),并且文件內(nèi)容還發(fā)生變化,git可以很好的感知這一變化,并且進(jìn)行處理。例如遠(yuǎn)端更新了文件內(nèi)容此時(shí),而本地更改了文件名。
六、Github的使用(2)

$ git mv second.txt  second1.txt

$ git commit -am"mv second.txt to second1.txt"    #本地修改文件名
[master 6066083] mv second.txt to second1.txt
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename second.txt => second1.txt (100%)

$ git fetch github
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From github.com:embedlinux/git_learning
   707f0f8..1979463  master     -> github/master

$ git branch -av                                      #合并遠(yuǎn)程分支
  Jone                  c2568ff [ahead 5, behind 1] Merge conflict file
* master                6066083 mv second.txt to second1.txt
  temp                  b0fc955 Merge three commits
  remotes/github/Jone   c2568ff Merge conflict file
  remotes/github/master 1979463 Update second.txt
  remotes/github/temp   b0fc955 Merge three commits
  remotes/zhineng/Jone  0b88b5a Merge remote-tracking branch 'github/Jone' into Jone

$ git merge github/master
Auto-merging second1.txt
Merge made by the 'recursive' strategy.
 second1.txt | 1 +
 1 file changed, 1 insertion(+)

$ cat second1.txt                     #本地文件名與遠(yuǎn)程不一致時(shí),git可以感知,并進(jìn)行merge
second file
undate the file!

$ git push --set-upstream github master
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 466 bytes | 155.00 KiB/s, done.
Total 4 (delta 2), reused 0 (delta 0)
To github.com:embedlinux/git_learning.git
   1979463..982232b  master -> master
Branch 'master' set up to track remote branch 'master' from 'github'.

進(jìn)行merge時(shí),彈出的確定信息
六、Github的使用(2)
35、把同一文件改成了不同的文件名如何處理
 當(dāng)把同一文件修改成了不同的文件名時(shí),git進(jìn)行merge時(shí),會(huì)同時(shí)保留兩個(gè)文件,需要程序員本人進(jìn)行處理,確定保留哪一個(gè)文件名。
36、禁止向集成分支執(zhí)行變更歷史的操作
37、GitHub為什么會(huì)火?
Git出現(xiàn)之前:
六、Github的使用(2)
Git出現(xiàn)之后:
六、Github的使用(2)
Github的十年:
六、Github的使用(2)
Github成功的因素:
六、Github的使用(2)
38、GitHub都有哪些核心功能?
Code review:
 代碼審查是獲得更好代碼的最可靠途徑,也是GitHub如何工作的基礎(chǔ)。 內(nèi)置的審核工具使代碼審核成為團(tuán)隊(duì)流程的重要組成部分。
Project management
 通過GitHub的項(xiàng)目管理工具盡早協(xié)調(diào),保持一致,并完成更多工作。
Integrations
 第三方提供集成服務(wù),需要付費(fèi)。
Team management
 團(tuán)隊(duì)管理
Social coding
 開源項(xiàng)目
Documentation
 文檔
Code hosting
 代碼存儲(chǔ)
39、怎么快速淘到感興趣的開源項(xiàng)目
 在github搜索時(shí),可以使用高級(jí)搜索功能
六、Github的使用(2)
 通常,在搜索欄搜索時(shí),github只會(huì)顯示在標(biāo)題和說明中進(jìn)行匹配的結(jié)果;要想搜索更多的內(nèi)容可以使用:<關(guān)鍵字> in:readme快速搜索所需要的文件
40、怎樣在GitHub上搭建個(gè)人博客
在Github上搭建個(gè)人博客非常容易,可以借鑒別人已有的代碼。
1、搜索代碼
六、Github的使用(2)
2、fork
六、Github的使用(2)
3、修改配置文件
六、Github的使用(2)
六、Github的使用(2)
4、新建博客
六、Github的使用(2)
5、成功
六、Github的使用(2)

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI