git remote -v 查看现有地址:
git remote set-url origin (新的git地址)
再次 git remote -v
git log //查询commit_id
git reset --hard commit_id //HEAD指向此次提交
git push origin HEAD --force //强制推到git仓库
git config --global user.name “Admin”
git config --global user.email “your email”
上面两行是创建 仓库后会有的直接复制
到指定文件夹内 右键
然后正常
git init
touch README.md
git add README.md
git commit -m “first commit”
git remote add origin xxx.git
git push -u origin master
结束之后去看了一下 只有README.md文件
最后 才知道 git add是添加文件的,所谓 git add README.md 是只加了这一个文件 这一步需要
git add .
add后面有个空格 然后有个英文句号 这样才会把所有文件夹下的文件都clone一份 最后继续下面的步骤
git commit -m “first commit”
git remote add origin xxx.git
git push -u origin master
这样就会把先文件夹下的所有文件 上传到指定地址了
//初始化仓库的入门教程
简易的命令行入门教程:
Git 全局设置:
git config --global user.name "萧翔"
git config --global user.email "673153653@qq.com"
创建 git 仓库:
mkdir admin-plus-main-zhlaji
cd admin-plus-main-zhlaji
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/tx-xiao-xiang/admin-plus-main-zhlaji.git
git push -u origin "master"
已有仓库?
cd existing_git_repo
git remote add origin https://gitee.com/tx-xiao-xiang/admin-plus-main-zhlaji.git
git push -u origin "master"