现在很多脚本可以使用GPT 预设词的替代,不再需要手动的脚本
GitHub pr怎么转换为草稿
.github贡献指南
Contributing
Before making any changes to this repository, we kindly request you to initiate discussions for proposed changes that do not yet have an associated issue. Please use our Discord server to initiate these discussions. For issue that already exist, you may proceed with discussions using our issue tracker or any other suitable method, in consultation with the repository owners. Your collaboration is greatly appreciated.
Please note: we have a code of conduct, please follow it in all your interactions with the Fiber project.
Pull Requests or Commits
Titles always we must use prefix according to below:
🔥 Feature, ♻️ Refactor, 🩹 Fix, 🚨 Test, 📚 Doc, 🎨 Style
- 🔥 Feature: Add flow to add person
- ♻️ Refactor: Rename file X to Y
- 🩹 Fix: Improve flow
- 🚨 Test: Validate to add a new person
- 📚 Doc: Translate to Portuguese middleware redirect
- 🎨 Style: Respected pattern Golint
All pull requests that contain a feature or fix are mandatory to have unit tests. Your PR is only to be merged if you respect this flow.
👍 Contribute
If you want to say thank you and/or support the active development of Fiber:
- Add a GitHub Star to the project.
- Tweet about the project on your 𝕏 (Twitter).
- Write a review or tutorial on Medium, Dev.to or personal blog.
- Support the project by donating a cup of coffee.
文件目录下怎么看到.ds_store
设置某一仓库Git信息
1 | git config user.name "JIeJaitt" |
本地与远端分支同步更新操作指南
我现在本地有更改,远端分支也有新的提交,我该怎么操作
当你的本地分支和远端分支都有新的提交时,你通常需要合并这些更改。以下是处理这种情况的一般步骤:
- 更新本地分支:
首先,你需要将远端分支的最新更改拉取到本地。这可以通过 git fetch 命令完成,它会从远端仓库获取最新的分支和提交,但不会自动合并到你的当前分支。
1 | git fetch origin |
这里 origin 是远端仓库的默认名称,如果你的远端仓库有不同的名称,请相应替换。
- 合并远端更改:
然后,你可以使用git merge命令将远端分支的更改合并到你的本地分支。
1 | git merge origin/your-branch-name |
将 your-branch-name 替换为你的远端分支名称。
- 解决冲突:
如果合并过程中出现冲突,你需要手动解决这些冲突。解决冲突后,你需要使用 git add 添加更改,并使用 git commit 提交解决冲突后的代码。
1 | git add . |
推送到远端:
解决完冲突并提交后,你可以将合并后的更改推送到远端仓库。1
git push origin your-branch-name
拉取最新的远端更改:
如果你想要将远端的最新更改拉取到本地,可以使用 git pull 命令,这个命令实际上是 git fetch 后跟 git merge 的快捷方式。
1 | git pull origin your-branch-name |
如果你想要使用 rebase 来整合更改,可以使用 git pull --rebase。
- 推送更改:
如果你进行了 rebase 或者合并,并且解决了所有冲突,你可以使用git push将你的更改推送到远端仓库。
1 | git push origin your-branch-name |
请注意,如果你的本地分支是基于远端分支的,通常使用 git pull(或 git pull --rebase)来合并远端更改是一个更简单的方法,因为它会自动处理合并过程。如果你的本地分支和远端分支是完全不同的分支,那么可能需要更复杂的合并策略。在进行这些操作之前,确保你的工作已经提交,以避免丢失任何更改。
我需要先add和commit我本地分支的内容吗
是的,通常情况下,在你将远端分支的更改合并到本地分支之前,你需要先确保你的本地分支的更改已经被提交。这样做有几个好处:
避免冲突:如果你的本地更改和远端更改有重叠,先提交本地更改可以减少合并时的冲突。
保持历史清晰:提交本地更改可以保持项目历史的清晰,使得每次提交都是一个完整的、独立的更改集。
备份:提交本地更改也是一种备份,以防在合并过程中出现问题,你可以从最后一次提交的状态恢复。
以下是你应该如何操作的步骤:
- 提交本地更改:
如果你还没有提交本地分支的更改,使用git add和git commit来提交这些更改。
1 | git add . |
替换 "Your commit message" 为你的提交信息。
- 拉取远端更改:
然后,你可以拉取远端分支的最新更改。
1 | git pull origin your-branch-name |
这里 your-branch-name 是你的远端分支名称。
- 解决合并冲突:
如果 git pull 操作导致合并冲突,你需要手动解决这些冲突,然后再次提交。
1 | git add . |
- 推送更改:
一旦合并完成并且没有冲突,你可以将合并后的更改推送到远端仓库。
1 | git push origin your-branch-name |
如果你的本地更改和远端更改没有重叠,或者你确定合并不会产生冲突,你也可以选择先合并远端更改,然后再提交你的本地更改。但是,通常建议先提交本地更改,以避免任何潜在的问题。
在多人协作开发时,经常碰到同事把最新修改推送到远程库,你在本地也做了修改,这个时候无论是执行 git pull 还是执行 git push 都会提示错误,我的解决方式如下:
先隐藏掉本地的修改,然后执行 git pull 从代码块拉取最新代码,具体步骤如下:
一. 输入 git status 查看本地的修改
二. 输入 git stash 隐藏掉本地修改
三. 输入 git pull 从代码库拉取更新
四. 输入 git stash pop stash@{版本号}
五. git add 、git commit 、git push 搞定