查看公钥私钥存放地址
~/.ssh/
查看远程分支
$ git branch -a
查看本地分支
$ git branch
切换到某个分支
切换回master分支
$ git checkout master
创建一个iss53分支并切换该分支
$ git checkout -b iss53
Switched to a new branch "iss53"
等效于
它是下面两条命令的简写:
$ git branch iss53 创建分支
$ git checkout iss53 切换到搞分支
…or create a new repository on the command line
echo "# ddd" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:XXXXX/FFFF.git
git push -u origin master
…or push an existing repository from the command line
git remote add origin git@github.com:XXXXX/FFFF.git
git push -u origin master
#查询当前状态
git status
使用中出现了两个问题:
1.创建完公钥和私钥放到github上之后
用ssh -T git@github.com验证,一直提示Permission denied (publickey)
最后发现的问题是在Finde前往文件夹~/.ssh/,用这个里面的id_rsa.pub,而不是存放在桌面的那个公钥,
这两个有啥不同,我还不知道,待研究
2.提示下面的错误,最后发现是语句写错了
error: pathspec 'add' did not match any file(s) known to git.
error: pathspec 'origin' did not match any file(s) known to git.
error: pathspec 'git@github.com:XLMARK/gitTest.git' did not match any file(s) known to git.
错误语句: git commit add origin git@github.com:XXXX/FFFF.git
应为: git remote add origin git@github.com:XXXX/FFFF.git
网友评论