Git初使用
git init
git add java\ --\ JVM的符号引用和直接引用.docx
git commit -m “first commit”
git remote add origin https://github.com/broomcorn-millet/test.git
git push -u origin master
it push 免密码
通用情况
1.使用文件创建用户名和密码
文件创建在用户主目录下:
touch .git-credentials
vim .git-credentials
https://{username}:{password}@github.com
1
2
3
记得在真正输入的时候是没有大括号的。
2.添加git config内容
git config --global credential.helper store
执行此命令后,用户主目录下的.gitconfig文件会多了一项:[credential]
helper = store
重新git push就不需要用户名密码了。
2、查看git用户名
git config user.name
3、查看邮箱配置
git config user.email
4、全局配置用户名
git config --global user.name “nameVal”
5、全局配置邮箱
git config --global user.email “eamil@qq.com”
fatal: 拒绝合并无关的历史
解决方法
在pull 时候, 添加–allow-unrelated-histories参数 即可.
$ git pull origin master --allow-unrelated-histories