- remote: The project you were looking for could not be found or you don't have permission to view it.
- fatal: repository 'http://xxx.xxx.com/xxx_tools/xxx-frontend.git/' not found
问题1:remote: The project you were looking for could not be found or you don't have permission to view it.
凡是问个为什么:因为全局认证未生效
-
- git config --global --list //查看是否配置
- git config --global user.name xxx //设置系统用户名和邮箱
- git config --global user.email xxx
-
- git config user.name userName //设置项目用户名和邮箱
- git config user.email email
-
- git config user.name 查看用户名
解决方式:1、在http://增加 “用户名@” ,yourusername改成自己gitLab的登陆名呦
http://yourusername@github.com/your/repository.git
基础命令:
-
- 设置系统用户名和邮箱
- git config --global user.name userName
- git config --global user.email email
- cat ~/.gitconfig //查看用户
-
- git clone http://github.com/your/repository.git 与远程仓库建立连接,clone仓库文件
-
- git init //初始化本地仓库
-
-
- git status //查看本地仓库状态
- git add . //将git仓库所在的文件夹下的所有内容添加到暂存区中
- git add 文件名 //将git仓库所在文件夹下的某个文件添加到暂存区中
- git rm --cached 文件名 //将某个文件从暂存区中删除
-
- git commit -m "注释" 文件名 //提交某个文件,并附带该次提交的版本信息。
- git commit -m "注释" . //提交所有文件。并附带此次提交的版本信息
- git rm 文件名 //从本地库中删除文件
- git reflog //查看历史命令。包括简单的版本信息,以及版本跳转
-
- git remote -v:可查询当前本地库连接的远程库
- git remote add 远程库别名(最好与本地库名称一致)远程库(http或者ssH密钥):将本地库与远程库连接
- git remote rm 远程库别名:取消本地库和远程库之间的连接关系
- git push 本地库别名 本地库分支:将本地库中的某个分支推送到远程库中
- git pull 远程库别名 远程库分支:将远程库分支上的内容拉取到当前本地库的分支上,并直接合并
-
- 查看分支
- git branch -v:查看当前存在的分支
- 创建分支
- git branch 分支名:创建分支
- 切换分支
- git checkout 分支名:切换到某个分支
- 删除分支
- git branch -d 分支名:删除指定分支