git使用中的一些问题

ubuntu14.04中从服务器下代码出错如下:

yingc@yingc:/media/sf_yingc/work/gitcode/androidtv$ repo sync box
The authenticity of host '[git.nationalchip.com]:29418 ([218.75.120.99]:29418)' can't be established.
RSA key fingerprint is 05:61:57:37:8c:7a:59:35:9e:9c:f0:d8:93:bf:d6:ea.
Are you sure you want to continue connecting (yes/no)? The authenticity of host '[git.nationalchip.com]:29418 ([218.75.120.99]:29418)' can't be established.
RSA key fingerprint is 05:61:57:37:8c:7a:59:35:9e:9c:f0:d8:93:bf:d6:ea.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[git.nationalchip.com]:29418,[218.75.120.99]:29418' (RSA) to the list of known hosts.

Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

之后我将git升级并repo init -b 到指定分支就好了。(mac下按照该方法还是不能下载代码-》mac下没有upgrade这一步)

具体原因尚不清楚

yingc@yingc:/media/sf_yingc/work/gitcode/androidtv$ git --version
git version 1.9.1
yingc@yingc:/media/sf_yingc/work/gitcode/androidtv$ sudo apt-get upgrade git
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
正在对升级进行计算... 完成
git 已经是最新的版本了。
下列软件包的版本将保持不变:
linux-generic-lts-wily linux-headers-generic-lts-wily
linux-image-generic-lts-wily
下列软件包将被升级:
bind9-host ca-certificates cpio dnsutils firefox glib-networking
glib-networking-common glib-networking-services ifupdown libbind9-90
libdns100 libgnutls-openssl27 libgnutls26 libgraphite2-3 libisc95 libisccc90
libisccfg90 libjasper1 liblwres90 libnss3 libnss3-1d libnss3-nssdb libnuma1
liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0 libperl5.18
libpixman-1-0 libsmbclient libssh-4 libssl1.0.0 libwbclient0 linux-libc-dev
openssl oxideqt-codecs perl perl-base perl-modules pm-utils python-samba
samba-common samba-common-bin samba-libs smbclient usbutils
升级了 45 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 3 个软件包未被升级。
需要下载 71.9 MB/89.3 MB 的软件包。
解压缩后会消耗掉 4,016 kB 的额外空间。
您希望继续执行吗? [Y/n] y

 

 

git代码仓库迁移(从github到oschina)

我的代码迁移相关命令(从github到coding):

  559  git clone https://github.com/jingzhishen/thirdparty.git
  560  ls
  561  cd thirdparty/
  562  l
  563  ls
  564  git log
  565  ls
  566  cd ..
  567  ls
  568  cp thirdparty/ thirdparty.bak -rf 
  569  ls
  570  cd thirdparty
  571  ls
  572  git br
  573  git remote set-url origin https://git.coding.net/jingzhishen/thirdparty.git
  574  git add .
  575  git st
  576  git log
  577  ls
  578  git st
  579  git ci -a -m "migrate commit."
  580  git push -u origin master
  581  git pull

 

git 撤销commit


方法:

    git reset --hard <commit_id>

    git push origin HEAD --force
 

 

Git Stash用法

aa

posted @ 2016-03-18 21:41  静之深  阅读(2001)  评论(0编辑  收藏  举报