通知短信+运营短信,5秒速达,支持群发助手一键发送🚀高效触达和通知客户 广告
# 基础命令 1. 在现有目录中初始化仓库 ```bash git init ``` 2. 对文件进行追踪与暂存 ```bash git add filename //ex. touch a.txt git add a.txt ``` 3. 提交更新到Git仓库 ```bash git commit -m "这是第一次提交" git commit -am "-a参数跳过add 全部提交被跟踪的文件" git commit --amend -m "取消上一次暂存结果" ``` 4. 克隆仓库 ```bash git clone <repo> <directory> ``` 5. 检查当前文件状态 ```bash git status ``` 6. 查看更新 ```bash git diff ``` 7. 移除文件 这将连带移除工作目录下文件 ```bash git rm <file> ``` 8. 移动文件 ```bash git mv file_from file_to ``` 9. 查看提交记录 ```bash git log ``` 10. 取消暂存文件 ```bash git reset HEAD file ``` 11. 查看远程仓库 ```bash git remote -v ``` 12. 添加远程仓库 ```bash git remote add <shortname> <url> ``` 13. 创建分支 ```bash git branch <branchname> ``` 14. 切换分支 ```bash git checkout <branchname> ``` 15. 合并分支 ```bash git merge <brabchname> ``` 16. 获取新提交 ```bash git fetch ``` 17. 远程拉取合并 ```bash git pull origin master #效果等同于两个命令 git fetch git merge ``` 18. 远程推送 ```bash git push origin master ```