1 git的操作命令有哪些
2 PyCharm 中常用的 Git 操作命令
3 -b参数的使用
4 stash命令在git中的使用
5 rebase在git中的使用
1 git的操作命令有哪些
1. **初始化一个新的仓库**:
git init
2. **克隆仓库**:
git clone <repository_url>
3. **添加文件到暂存区**:
git add <file1> <file2> ...
或者
git add . # 一定要注意后面的这个点
4. **提交更改**:
git commit -m "Commit message"
5. **查看状态**:
git status
6. **查看提交历史**:
git log
7. **创建分支**:
git branch <branch_name>
8. **切换分支**:
git checkout <branch_name>
9. **合并分支**:
git merge <branch_name>
10. **拉取远程仓库的变化**:
git pull
11. **推送本地提交到远程仓库**:
git push
12. **查看远程仓库**:
git remote -v
13. **添加远程仓库**:
git remote add <remote_name> <repository_url>
14. **创建并切换到新分支**:
git checkout -b <branch_name>
15. **删除分支**:
git branch -d <branch_name>
16. **撤销工作目录中的修改**:
git checkout -- <file>
17. **撤销已暂存的修改**:
git reset HEAD <file>
18. **重置当前分支到指定提交**:
git reset --hard