# 设置一个可识别的名称,用于在审查版本历史时进行认可
\( git config --global user.name "Your Name"</p><p># 设置与每个历史标记相关联的电子邮件地址<br>\) git config –global user.email “”
git config –global –list .
# 设置 Git 的默认编辑器
\( git config --global core.editor "code --wait"</p><p># 初始化名为 my-project 的新存储库<br><br>\) git init my-project
\( git remote add origin repository-url</p><p>\) git pull origin main
\( git checkout main</p><p>\) code file-name # 例如,code index.html
# 检查当前分支的状态
\( git status # 在主分支上</p><p># 将文件添加到暂存区<br><br>\) git add . # 要提交的更改:
或
\( git add 文件名 # 要提交的更改:</p><p># 将更改提交到当前分支<br><br>\) git commit -m “提交消息” # 例如,git commit -m “Initial commit”
# 将更改推送到远程存储库
\( git push origin main # 例如,git push origin master</p><p># 创建一个新分支<br><br>\) git branch <branch-name> # 例如,git branch feature-branch
# 切换到新创建的分支
\( git checkout <branch-name> # 例如,git checkout feature-branch</p><p># 删除分支<br><br>\) git branch -d <branch-name> # 例如,git branch -d feature-branch

\( git checkout feature-branch</p><p>git checkout feature-branch<br>切换到一个新分支 'feature-branch'<br>分支 'feature-branch' 设置为跟踪 'origin/feature-branch'。</p><p>\) touch feature-branch-file.txt
\( echo "这是特性分支中的一个文件" >> feature-branch-file.txt</p><p>\) git add .
\( git commit -m "向特性分支添加文件"</p><p>\) git push origin feature-branch

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/176918.html