Files
mengyanote/public/mengyanote/Github/Linux下使用git探索.md
2025-10-05 19:44:37 +08:00

1.0 KiB
Raw Blame History

修改全局代理为http1

git config --global http.version HTTP/1.1

相当于 git fetch + git merge会把远程最新提交合并到你当前分支。

git pull

这会把你的本地提交临时“挪开”,先更新远程提交,然后再把你的提交放回去,避免多余的合并记录。

git pull --rebase

如果只想下载最新提交但不合并

git fetch

树萌芽GitHub仓库提交代码通用密钥

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

1. 添加所有改动

git add .

2. 提交,写上提交说明

git commit -m "更新说明"

3. 推送到远程仓库(假设分支是 main

git push origin main

压缩成一条命令实现:

git add . && git commit -m "update" && git push origin main

或者设置命令别名,比如写进 ~/.bashrc 或 ~/.zshrc

alias gopush='git add . && git commit -m "update" && git push origin main'

注意:校园网可能会屏蔽梯子,必要时开热点提交