Linux command
git-gh-pages 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create a gh-pages branch
git gh-pages
说明
git gh-pages creates and sets up a gh-pages branch for GitHub Pages hosting. This is a git-extras command that automates the creation of an orphan branch with an empty history, suitable for hosting static websites independent of the main project history. The command creates the orphan branch, removes all tracked files, and makes an initial empty commit. After creation, the gh-pages branch can be populated with HTML, CSS, and JavaScript files. When pushed to GitHub, the repository content becomes accessible as a website at https://username.github.io/repository.
FAQ
What is the git-gh-pages command used for?
git gh-pages creates and sets up a gh-pages branch for GitHub Pages hosting. This is a git-extras command that automates the creation of an orphan branch with an empty history, suitable for hosting static websites independent of the main project history. The command creates the orphan branch, removes all tracked files, and makes an initial empty commit. After creation, the gh-pages branch can be populated with HTML, CSS, and JavaScript files. When pushed to GitHub, the repository content becomes accessible as a website at https://username.github.io/repository.
How do I run a basic git-gh-pages example?
Run `git gh-pages` in a terminal, then adjust file names, paths, flags, or remote targets for your system.