Useage of Git
Git SSH: OpenSSH Legacy Options
http://www.openssh.com/index.html
https://blog.csdn.net/guoguo527/article/details/50504630
Unable to negotiate with legacyhost: no matching host key type found. Their offer: ssh-dss
OpenSSH 7.0 and greater similarly disable the ssh-dss (DSA) public key algorithm. It too is weak and we recommend against its use. It can be re-enabled using the HostKeyAlgorithms configuration option:
ssh -oHostKeyAlgorithms=+ssh-dss user@legacyhost
or in the ~/.ssh/config file:
Host somehost.example.org
HostKeyAlgorithms +ssh-dss
For my case: (Windows 8)
vim ~/.ssh/config
1 Host git-amr-4.devtools.intel.com
2 HostKeyAlgorithms +ssh-dss
更新远程分支到本地
git remote update origin --prune,这里要注意下,如果你的remote branch不是在origin下,按你得把origin换成你的名字。
1. $ git remote update origin --prune
2. Fetching origin
3. remote: Counting objects: 510, done.
4. remote: Compressing objects: 100% (421/421), done.
5. remote: Total 510 (delta 274), reused 0 (delta 0)
6. Receiving objects: 100% (510/510), 602.34 KiB | 0 bytes/s, done.
7. Resolving deltas: 100% (274/274), completed with 57 local objects.
8. From http://172.20.31.101/Android/XNOnline_Studio
9. 591c217f..c24cc128 Branch_3.6.0 -> origin/Branch_3.6.0
10. 124c9175..2152c0d9 Branch_3.5.0 -> origin/Branch_3.5.0
11. * [new branch] Branch_3.7.0 -> origin/Branch_3.7.0
12. 8193a08d..c24cc128 master -> origin/master
获取所有log号记录
git log | grep commit > ../commit.log
远程版本回退:
先用git log看看提交的版本历史记录,找到你要回退的版本的版本号;
然后,执行命令git reset --hard "版本号"
远程分支删除
git push <remote-name> :<local-branch-name>
自己的远程分支版本回退的方法
如果你的错误提交已经推送到自己的远程分支了,那么就需要回滚远程分支了。
首先要回退本地分支:
git reflog
git reset --hard Obfafd
紧接着强制推送到远程分支:
git push -f
添加本地远程分支
git remote add origin xiongyuan@my-workstation:/home/xiongyuan/workspace/backup/repository/.git
git remote set-url origin URL
git上传本地分支到github项目分支
http://blog.csdn.net/qq_27437967/article/details/71189571
https://github.com/abby0100/wechat.git
Git init
git add *
git commit -m "test"
git branch test
git checkout test
git remote add origin https://github.com/yangxiaoyan20/BowlingScore.git
git push origin test
拉取远程分支并创建本地分支
git pull origin remote-branch:remote-branch
--Error
git pull origin 20180305-CPU-GEMM-version:20180305-CPU-GEMM-version
--OK
git checkout -b 20180315-1-hardcode-two-video-merged-ok origin/20180315-1-hardcode-two-video-merged-ok
--Error:
Cannot update paths and switch to branch at the same time
--Solution:
git remote show origin
git remote update
git branch -av
git checkout -b 20180315-1-hardcode-two-video-merged-ok origin/20180315-1-hardcode-two-video-merged-ok
clone repository
$ git clone ssh://xiongyuan@xxx.xxx.xxx.xxx:/home/xiongyuan/<path>/examples/opencl/opencl_hello_world/.git