git使用

第一步:输入你的github账户邮箱和用户名
命令:$ git config --global user.email “you@example.com”
命令:$ git config --global user.name “Your Name”
第二步:锁定代码文件所在的本地文件夹路径
命令:$ cd 文件路径
第三步:将该文件夹设定为本地库
命令:$ git init
第四步:将代码文件预载入
命令:$ git add 文件名
命令:$ git commit -m ‘描述’
第五步:选择分支
命令:$ git branch -M 分支名(分支名例如:main)
第六步:输入你的github上的库的https链接
命令:$ git remote add origin 库的https链接
第七步:将代码上传到github的数据库
命令:$ git push -u origin 分支名(分支名例如:main)
常见问题:
1、输入$ git commit -m 'test’提示
Author identity unknown

*** Please tell me who you are.

Run

git config --global user.email “you@example.com”
git config --global user.name “Your Name”

to set your account’s default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got ‘user@LAPTOP-2GP5CQLE.(none)’)

user@LAPTOP-2GP5CQLE MINGW64 /d/test (master)
$ git config --global user.email “1771915465@qq.com”

user@LAPTOP-2GP5CQLE MINGW64 /d/test (master)

解决方案:此时你需要输入你的github账户邮箱和用户名
命令:$ git config --global user.email “you@example.com”
命令:$ git config --global user.name “Your Name”
然后接着第五步继续

2、输入$ git push -u origin main后可能提示
δ▒▒▒▒▒▒▒▒쳣: System.ComponentModel.Win32Exception: ▒▒Ч▒Ĵ▒▒ھ▒▒▒▒
▒▒ MS.Win32.ManagedWndProcTracker.HookUpDefWindowProc(IntPtr hwnd)
▒▒ MS.Win32.ManagedWndProcTracker.OnAppDomainProcessExit()
▒▒ MS.Internal.ShutDownListener.HandleShutDown(Object sender, EventArgs e)
并弹出一个让你登录github的窗口

解决方案:登录完成就好了,等一会儿git的窗口就会自动上传,会有提示的
后续如遇到问题再添加

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值