在进行修改文件之前我们需要查看我们是在那个分支上进行修改的(默认在实际开发中我们不使用master分支)
我们修改的文件
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vi7vYsPC-1650620633362)(/Users/lifuwei/Library/Application Support/typora-user-images/image-20220422095720046.png)]
查看修改后的状态
git status
On branch l
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: hello.py
no changes added to commit (use "git add" and/or "git commit -a")
通过以上代码查看我们需要上传我们已经修改的代码
git add hello.py
git commit -m ‘update the hello code’
git push
此时我们已经推送代码到了我们的gitee上了,我们可以在gitee上面查看
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-cfOPYrZa-1650620633363)(/Users/lifuwei/Library/Application Support/typora-user-images/image-20220422102129343.png)]
本文介绍了如何使用Git查看当前分支、检查文件修改状态,并将修改后的代码提交到远程仓库。首先,通过`git status`检查修改状态,然后使用`git add`跟踪改动,接着用`git commit`提交更新,并通过`git push`将更改推送到gitee。这是日常开发中更新代码的基本流程。
8053

被折叠的 条评论
为什么被折叠?



