You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
files/rocketgit本地Git仓库_成功(2025).txt

117 lines
5.7 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

永久登录刮擦码:
在阿里云盘里腾讯——Linux——txt文件夹里找-rocketgit本地Git仓库_成功(2024)
在马云geren代码库里找
###################################
创建仓库edit编辑,名随便 设public{公开} 设默认主分支main或master 下边随便 建立。后先设置admin
Edit Repo rights Refs rights Path rights Delete Lock
编辑 回购权 参考资料权利 道路权 删除 锁定
edit编辑,名随便 设public{公开} 设默认主分支main或master 下边随便 建立。
Repo rights在设置授予回购权用户使用“自己用户”全部。
Refs rights重要裁判权用户使用“*”全部. 创建分支删除分支必须打对号,也可全部对号
Path rights路径用户使用“*”全部.
在主页设置ssh密钥在设置 登录令牌。(已有仓库设置过就不用设置了)
###################################
在项目上打开自己的 Git Bash Here 然后输入git config --system --unset credential.helper退出之后重新拉取项目
执行命令之后,再次pull或push时会缓存输入的用户名和密码:
git config --global credential.helper store
###################################
################################################
#git pull --rebase origin main#先取消掉本地库中刚刚的commit在pull合并代码设置。然后再进行push即可
###################################成功
清除git缓存中的用户名的密码
git credential-manager uninstall
在第一次提交之前,不要忘记设置你的 git 环境:
git config --global user.name "dongge"
git config --global user.email "771281703@qq.com"
ssh-keygen -t rsa -C 771281703@qq.com
cat ~/.ssh/id_rsa.pub
###################################
如果您本地没有该项目,并且想要克隆它:
git clone https://rocketgit.com/user/dongge/m5 m5
#git init --initial-branch main --object-format sha1
#git reset --hard d32d7c49af9203f3ebc414d5f73a38c00b0d4c13 #彻底删除版本库git reset --hard ca7719755e77a7c30500d7d1854c255769e13322
#git rm -r --cached . ##git checkout HEAD~1#取消上2次提交git reset HEAD~2#转到git checkout main#
git add . && git commit -m 'xxxx' --no-verify && git push origin main #直接上传,大文件不行
git remote add origin https://rocketgit.com/user/dongge/m5
###################################
#git checkout -b main #创建分支改为远程的main#git branch -m 旧名称 新名称git branch -m master main##转到分支git checkout main
#输入用户名dongge 二次验证密钥{AUthenticator里的验证码或永久刮擦码} git push -uf origin main:18#强制覆盖上传
git push origin main ## git push -u origin main ## git push -uf origin master:main ##git push -u origin master:master
git push origin master ## git push -u origin master ###git push origin main:master ###git push -f就可以强制推送
git push -f origin main ## git push -u origin master -f #强制覆盖原有的分支git push -uf origin master
删除远程分支git push origin --delete master
###################################
git pull --rebase origin master#push后在pull合并同步代码设置。然后再进行下一次push即可
##########################################################
官方推送步骤:
##git status 删除未推送缓存里的文件如: git rm --cache m/lib/fan.txt
git pull --rebase origin main#代码和并
git commit --amend -m 'OCT: 删除无用变量代码'
git remote rm origin ##先删除远程 Git 仓库
git remote add origin https://rocketgit.com/user/dongge/m1
#########################################################
git branch -a
获取所有的列表然后切换到需要删除的分支git checkout main
最后删除该分支git push origin --delete main
git撤销合并错误分支
方法1. git reset -hard commit_id
方法2. gitrevert-m 1 branch_name reset:
克隆指定分支git clone -b 分支名称 http://xxxxxxx.git
删除远程分支aaaa
我比较喜欢的简单方式,推送一个空分支到远程分支,其实就相当于删除远程分支:
$ git push origin :aaaaaa
也可以使用:
$ git push origin --delete aaaaaa
########################################################
命令行 Git 客户端不会立即记住您的凭据。确保您运行的是 Git 版本 1.7.12.1 或更高版本,然后使用以下命令启用密码缓存:
git config --global credential.helper cache
这将使 git 在您输入凭据后 15 分钟内记住您的凭据。要增加该限制,请使用以下命令并指定时间(以秒为单位):
git config --global credential.helper 'cache --timeout=3600'
###################################
````````````````````````````````
提示:
在第一次提交之前不要忘记设置你的git环境
git config --global user.name "dongge"
git config --global user.email "771281703@qq.com"
如果你有一个本地项目但没有用Git进行版本控制
cd local_project_dir
git init --initial-branch main --object-format sha1
git remote add origin https://rocketgit.com/user/dongge/builds
# 或
git remote add origin ssh://rocketgit@ssh.rocketgit.com/user/dongge/builds
# 提交...
git push --set-upstream origin main
git push origin --all
git push origin --tags
如果您正在从另一个Git托管提供商切换
cd local_project_dir
git remote set-url origin https://rocketgit.com/user/dongge/builds
# 或者
git remote set-url origin ssh://rocketgit@ssh.rocketgit.com/user/dongge/builds
如果你没有该项目的本地副本并且想克隆它到文件夹builds
git clone https://rocketgit.com/user/dongge/builds builds
# 或者
git clone ssh://rocketgit@ssh.rocketgit.com/user/dongge/builds builds
cd builds
``````````````````````````````