标签归档:git

git常用命令学习笔记

初始化git仓库

git init

把文件添加进版本库

git add 1.txt

把文件提交到版本库

git commit -m 'add 1.txt'

git add命令实际上就是把要提交的所有修改放到暂存区(Stage),然后,执行git commit就可以一次性把暂存区的所有修改提交到分支

继续阅读

github报错failed to push some refs to ‘git

$ git push origin master
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
To git@github.com:Tuesdday/pythoncode.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@github.com:Tuesdday/pythoncode.git'
#提交代码时报错
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

继续阅读