本地git提交远程仓库示例(附指令解释)
// 先创建文件
echo "# gin-may" >> README.md
// git 初始化
git init
// 添加要提交至远程仓库的文件(当你项目中包含了.gitignore文件,可以通过git add .选择全部提交)
git add README.md
// commit操作
git commit -m "first commit"
// 将当前分支重命名为main 在Git中,默认分支通常是master(master被认为是可能令人联想到歧视色彩的术语,因此越来越流行使用main)
git branch -M main
// 设置远程仓库地址
git remote add origin git@github.com:<username>/<project_name>.git
// 推送
git push -u origin main
git status 也是 Git 中一个非常常用的命令,用于显示工作目录和暂存区的状态。当你执行 git status 命令时,它会告诉你哪些文件已经被修改、哪些文件是新的且尚未被追踪、哪些文件已经被暂存等待提交等。

浙公网安备 33010602011771号