【Git】Git问题

github常见操作和常见错误!

Q: This is usually caused by another repository pushing:refusing to merge unrelated histories

在已有的仓库中提交一个保存图片的文件夹,git push遇到问题

error: failed to push some refs to '我相关联的git仓库'
hint: Updates were rejected because the remote contains work that you do
!    refs/heads/master:refs/heads/master    [rejected] (fetch first)
Done
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.

A: 执行 git pull origin master --allow-unrelated-histories

修改github中的图片大小

1. 不能修改尺寸

![SVM对偶问题](https://github.com/michelleweii/ParallelSMO/blob/master/picture/svm%E5%AF%B9%E5%81%B6%E9%97%AE%E9%A2%98.png)

2. width可以修改尺寸

SVM对偶问题

github删除.DS_Store

关于GitHub上传中忽略.DS_Store的方法说明

git rm --cached .DS_Store

Git 如何 clone 非 master 分支的代码 

先git clone整个仓库

git clone [email protected]:xxxxx.git

直接使用命令 git branch -r #查看远程分支

git branch -a #查看所有分支

会显示

origin/HEAD -> origin/master
origin/daily/1.2.2
origin/daily/1.3.0
origin/daily/1.4.1
origin/develop
origin/feature/daily-1.0.0
origin/master

然后直接 git checkout origin/daily/1.4.1

 

你可能感兴趣的:(其他)