初次安装后需全局设置用户名及email
git config --global --list
列出当前全局系统配置,如果需要列举当前仓库的配置,可以吧global更换为local
1 | git config --global user.name "your name" |
reset
git log
打印出log后按Q退出,log里面会有hash字符串,复制以后git reset hasn字符串,可撤销操作。
git ignore
在git目录下新建 .gitgnore文件
1 | /node_modules/ |
git branch
新建分支1
git branch test
切换分支1
git checkout test
分支合并
1 | git merge test |
拉取指定分支代码
git pull origin test
推送指定分支代码
git push origin test