17_6_30 github 教程:版本回退等+ 显示隐藏

github教程:版本回退等

git 覆盖仓库问题

显示隐藏

ls -ah或者 ls -a

1.克隆链接:

git clone git@github.com/githubname/Test1.git
或者 git clone https://github.com/githubname/Test1.git

2.git init

git init

2.增加.ssh文件获取key:

ssh-keygen -t rsa -C "*******@qq.com"

3.关联远程仓库

git remote add origin https://github.com/githubname/Test1.git
或者git remote add origin git@github.com/githubname/Test1.git

4.Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.冲突

git push -u origin master -f// ***git push -f 代表 git强推**一般不要这么做** ***

总结:
1.git clone (and pull)
2.git .ssh 并添加
3.git remote add https://
4.git add commit push

git remote 显示远程仓库的名字(本机上的别名)
git remote -v 远程仓库的路劲

克隆后,创建了本地仓库,不需要git init
但没有关键起来,
所以需要第三步,

原文地址:https://www.cnblogs.com/du1991/p/7097173.html