Github配置:1 使用.gitignore的意义

(01:24-02:04) 2.4: 配置 .gitignore 忽略生成文件

  • 说明Hugo 项目中的某些文件/目录是自动生成的不应该提交到源代码仓库,包括:
    • public/Hugo 生成的静态网站文件目录。
    • resources/Hugo 处理后的资源缓存目录。
    • hugo.build.lock:构建锁文件。
    • hugo.exe:(如果在 Windows 下)Hugo 可执行文件本身。
  • 操作:在本地 Hugo 项目根目录下,创建一个名为 .gitignore 的文件。
  • 操作:编辑 .gitignore 文件,将上述需要忽略的文件名或目录名(如 public, resources, hugo.build.lock, hugo.exe)添加进去,每行一个。
  • 目的保证上传到 GitHub 的是最干净、最原始的 Hugo 项目文件。 《♓目的就是不要让静态资源污染源码,因为hugo-main是源代码仓库,源代码仓库不负责展示github page,只负责运行action得到静态资源给其它部署仓库hugo-dev,所以没必要把多余的静态资源上传到hugo-main,反正在hugo-main展示这些静态资源》 <git add .:添加所有文件到暂存区(♎.gitignore 会生效,忽略指定文件)。>

Github配置:2 Github Pull 与 Github Push,pull对分支后才能用push

[0 检查当前分支的跟踪关系] <命令:git status;因为如果追踪错误,那么我想要push推送到我想要的分支很可能失败,因为追踪错误的缘故,pull的是其它的分支,因此我想要的分支就没法push了>

[1 取消本地 main 分支对 所有分支 的跟踪] <命令:git branch –unset-upstream>

[[[[2 指定pull拉取main的分支(为了push到main,只能强制指定要拉取main分支)] 《命令:git pull origin main》

[[[[3 pull拉取了main分支后 就能push推送到main分支了] <命令:git push -u origin main>

My First Post

A blog (a truncation of “weblog”) is an informational website published on the World Wide Web consisting of discrete, often informal diary-style text entries (posts). Posts are typically displayed in reverse chronological order so that the most recent post appears first, at the top of the web page. Until 2009, blogs were usually the work of a single individual,[citation needed] occasionally of a small group, and often covered a single subject or topic. In the 2010s, “multi-author blogs” (MABs) emerged, featuring the writing of multiple authors and sometimes professionally edited. MABs from newspapers, other media outlets, universities, think tanks, advocacy groups, and similar institutions account for an increasing quantity of blog traffic. The rise of Twitter and other “microblogging” systems helps integrate MABs and single-author blogs into the news media. Blog can also be used as a verb, meaning to maintain or add content to a blog.

0%