温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

六、Github的使用(2)

发布时间:2020-07-13 02:53:14 来源:网络 阅读:342 作者:少年不在了 栏目:开发技术

34、同时变更了文件名和文件内容如何处理
当远端仓库与本地的文件名不一致时,并且文件内容还发生变化,git可以很好的感知这一变化,并且进行处理。例如远端更新了文件内容此时,而本地更改了文件名。
六、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                                      #合并远程分支
  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                     #本地文件名与远程不一致时,git可以感知,并进行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'.

进行merge时,弹出的确定信息
六、Github的使用(2)
35、把同一文件改成了不同的文件名如何处理
 当把同一文件修改成了不同的文件名时,git进行merge时,会同时保留两个文件,需要程序员本人进行处理,确定保留哪一个文件名。
36、禁止向集成分支执行变更历史的操作
37、GitHub为什么会火?
Git出现之前:
六、Github的使用(2)
Git出现之后:
六、Github的使用(2)
Github的十年:
六、Github的使用(2)
Github成功的因素:
六、Github的使用(2)
38、GitHub都有哪些核心功能?
Code review:
 代码审查是获得更好代码的最可靠途径,也是GitHub如何工作的基础。 内置的审核工具使代码审核成为团队流程的重要组成部分。
Project management
 通过GitHub的项目管理工具尽早协调,保持一致,并完成更多工作。
Integrations
 第三方提供集成服务,需要付费。
Team management
 团队管理
Social coding
 开源项目
Documentation
 文档
Code hosting
 代码存储
39、怎么快速淘到感兴趣的开源项目
 在github搜索时,可以使用高级搜索功能
六、Github的使用(2)
 通常,在搜索栏搜索时,github只会显示在标题和说明中进行匹配的结果;要想搜索更多的内容可以使用:<关键字> in:readme快速搜索所需要的文件
40、怎样在GitHub上搭建个人博客
在Github上搭建个人博客非常容易,可以借鉴别人已有的代码。
1、搜索代码
六、Github的使用(2)
2、fork
六、Github的使用(2)
3、修改配置文件
六、Github的使用(2)
六、Github的使用(2)
4、新建博客
六、Github的使用(2)
5、成功
六、Github的使用(2)

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI