Fixed issues
Git :
#Company Account :
C:\Users\shunduan>ssh -T git@github.com
#Hi yayalingo! You've successfully authenticated, but GitHub does not provide shell access.
解决推送被拒绝的问题
-
拉取远程仓库最新更改:
git pull origin main
-
解决任何冲突并提交(如果有冲突):
- 打开并编辑有冲突的文件,解决冲突
- 然后执行以下命令
git add . git commit -m "Resolved merge conflicts"
-
推送本地更改到远程仓库:
git push -u origin main
Git 常用命令
初始化和配置
git init # 初始化一个新的Git仓库
git clone <repository_url> # 克隆远程仓库
git config --global user.name "Your Name" # 设置用户名
git config --global user.email "your_email@example.com" # 设置用户邮箱
git remote add origin https://github.com/yayalingo/Sanya.github.io.git #添加远程link
基本操作
git status # 查看仓库当前状态
git add . # 添加所有更改的文件到暂存区
git commit -m "Commit message" # 提交更改并添加提交消息
git pull origin main # 拉取远程仓库最新更改并合并到本地
git push origin main # 推送本地更改到远程仓库
分支操作
git branch # 列出所有本地分支
git branch <branch_name> # 创建一个新分支
git checkout <branch_name> # 切换到指定分支
git merge <branch_name> # 合并指定分支到当前分支
git branch -d <branch_name> # 删除指定分支
日志和查看
git log # 查看提交历史
git diff # 查看未暂存的更改
git show <commit_hash> # 显示指定提交的详细信息
这些命令应该覆盖了大多数常见的 Git 操作场景。如果你需要更详细的命令或帮助,随时可以使用 git help <command>
来查看具体命令的详细用法。例如:
git help push
希望这些简化的指南和常用命令能够帮助你更有效地使用 Git。
Push -
-
初始化仓库并添加文件:
Copy git init git add yayalingo.github.io/ git commit -m "Initial commit"
-
添加远程仓库并推送:
git remote add origin git@github.com:yayalingo/yayalingo.github.io.git git push --set-upstream origin master
Path : C:\Users\shunduan\OneDrive - Magna\Desktop\file\KB\GItHub_Page
Jekyll
bundle exec jekyll serve #本地查看页面Jekyll
bundle exec jekyll serve --baseurl=""
https://jekyllrb.com/showcase/
We only cover RubyInstaller-2.4 and newer here. Older versions need to install the Devkit manually.
- Download and install a Ruby+Devkit version from RubyInstaller Downloads. Use default options for installation.
- Run the
ridk install
step on the last stage of the installation wizard. This is needed for installing gems with native extensions. You can find additional information regarding this in the RubyInstaller Documentation. From the options chooseMSYS2 and MINGW development toolchain
. - Open a new command prompt window from the start menu, so that changes to the
PATH
environment variable becomes effective. Install Jekyll and Bundler usinggem install jekyll bundler
- Check if Jekyll has been installed properly:
jekyll -v
If you found this useful, please cite this as:
Duan, Sanya . (Nov 2024). Fixed issues. https://yayalingo.github.io.
or as a BibTeX entry:
@article{duan2024fixed-issues,
title = {Fixed issues},
author = {Duan, Sanya .},
year = {2024},
month = {Nov},
url = {https://yayalingo.github.io/blog/2024/Git_fixed/}
}
Enjoy Reading This Article?
Here are some more articles you might like to read next: