git常⽤操作

[复制链接]
leda 发表于 2022-12-7 16:53:52 | 显示全部楼层 |阅读模式
git常⽤操作

git config --global user.name "*****"
git config --global user.email "xxxx@xxx.com" git init
git add .
git commit -m "commit context"
git remote add origin https://gitee.com/ybeyond/test_gitee.git
git push -u origin master git pull
git branch                    #查看分⽀情况
git branch develop            #新建develop分⽀
git branch -d develop         #删除develop分⽀
git checkout develop          #新建并切换到develop分⽀
git merge develop             #合并到develop分⽀

国内一般用gitee码云的比较多,建议使用。
https://gitee.com

在psuh或者sync的过程中,多次输入用户名和密码,可以针对单个仓库或者全局进行配置,只要⼀次输⼊,下次就不需要再重复输⼊。命令如下:
# 单个仓库
git config credential.helper store

https://gitee.com/help/articles/4122


问题:git错误 error: failed to push some refs to 'https://github.com/




简易的命令行入门教程:
Git 全局设置:
git config --global user.name "test"git config --global user.email "12170118+test@user.noreply.gitee.com"
创建 git 仓库:
mkdir grocd grogit init touch README.mdgit add README.mdgit commit -m "first commit"git remote add origin https://gitee.com/test/test.gitgit push -u origin "master"
已有仓库?
cd existing_git_repogit remote add origin https://gitee.com/test/test.gitgit push -u origin "master"

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|RuZhuo ( 鄂ICP备16015978号-8 )

GMT+8, 2024-4-30 04:56 , Processed in 0.047139 second(s), 27 queries .

Powered by RuZhuo

快速回复 返回顶部 返回列表