您现在的位置是:网站首页> 编程资料编程资料
Git中需要熟记的命令小结_linux shell_
2023-05-26
401人已围观
简介 Git中需要熟记的命令小结_linux shell_
提交流程相关
查看文件改动以及新增的文件
git status
添加新增文件
git add your_file_path // 添加全部文件 git add * // 添加某类型文件 git add dir/*.js
简单的提交文件
git commit -m "Commit message"
提交你所有的修改文件以及添加的文件
git commit -am 'your message'
撤销修改某个文件
git checkout --
放弃本地所有修改
git fetch origin git reset --hard origin/master
更新相关
更新远程代码
git pull
显示合并冲突文件
git diff
查看某个合并冲突文件
git diff --base
添加解决冲突后文件
git add
提交你的改动到主干上
git push origin master
分支相关
创建新分支并且切到该分支
git checkout -b your_branch_name
切换分支
git checkout your_branch_name
查看所在分支以及分支列表
git branch
提交给某分支
git push origin your_branch_name
对比分支差异
git diff
合并某分支到你当前所在分支
git merge your_branch_name
删除远程仓库的分支
git push origin :your_branch_name
删除某分支
git branch -d your_branch_name
标签和项目初始化
git init 初始化项目名称
git tag 0.9.1
配置
配置你的用户名和邮箱
git config --global user.name "Jack" git config --global user.email jack@gmail.com
结束语
Git中需要熟记的命令小结到这就结束了,希望这篇文章的内容对大家的学习工作能有所帮助,如果有疑问可以留言讨论。
您可能感兴趣的文章:
相关内容
- Linux shell实现HTTP服务示例代码_linux shell_
- Linux中scp命令获取远程文件的方法_linux shell_
- 一个shell小案例(创建日期目录)_linux shell_
- linux下2个检查tcp连接的命令_linux shell_
- linux awk高级应用实例_linux shell_
- linux shell实现求一个多维数组中的最大和最小值_linux shell_
- 一个监控网卡流量的shell脚本_linux shell_
- 自动化下载并检测ftp文件备份的shell脚本_linux shell_
- linux shell实现转换输入日期的格式_linux shell_
- 用来检测输入的选项$1是否在PATH中的shell脚本_linux shell_
