• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
langQ
博客园    首页    新随笔    联系   管理    订阅  订阅
git常用命令

git常用命令

git status
确认是否有文件变更或新文件的红字显示的文件名。

git add *.txt
有的话,把这些文件用git add命令加上。

git status
在check一下文件的状态,此时文件名变成绿色。

git commit -m "2024/03/10 commit"
提交文件,并写上注释。

git push
最终往git上push,完成提交。


●本地文件发生修改,之后想取消修改,用github上的最新资源进行恢复:
git restore <file>

例如:D:\Git\VBA>git restore "sample code/macro_sample.xlsm"
文件路径里包含空格,所以两边加上了双引号。

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   sample code/macro_sample.xlsm

●最新のリポジトリを取得する
git logコマンドで確認する
git log

git pull origin main
git pullコマンドでoriginリポジトリのmainブランチの最新の内容を取得してきています。

●
●
●
●
●
●
●
●
●
●

posted on 2024-03-10 18:29  嚯嚯go  阅读(16)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3