git常见命令

问题一 、远程--本地

在远程建立一个仓库Data_Preprocessing

git clone [email protected]:Babyzpj/Data_Preprocessing.git  将该仓库克隆到本地

[root@ZPJ Git_rpo]# git add Data_Preprocessing/

[root@ZPJ Git_rpo]# git status

[root@ZPJ Git_rpo]# git commit -m '提交'

[root@ZPJ Git_rpo]# git status

On branch master

nothing to commit, working tree clean

问题二、

git常见命令_第1张图片

问题三、

git常见命令_第2张图片


问题四:

error: failed to push some refs to '[email protected]:Babyzpj/MachineLearning.git'

解决办法:git pull origin master


问题五:clone一个项目时,会将将其它项目的文件clone到该文件下

git常见命令_第3张图片

会发现有两个push,这很不正常。

解决办法:考虑到以前的版本的配置影响,于是直接删除了这个配置文件

 rm  -rf  /root/.gitconfig

然后再进各个项目查看配置文件各项目的配置文件返现已经正常

git常见命令_第4张图片

再次克隆项目时,发现,该问题已经解决!

问题六:删除一个本地项目

直接 

 rm -rf projict_name

git add .

git commit -m 'remove project_name'

问题七:git pull时出现问题

git常见命令_第5张图片

解决办法:git pull --allow-unrelated-histories

参考了:

git常见命令_第6张图片

你可能感兴趣的:(git常见命令)