[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
我的方法只是用于自己的推送,如果哪里有错希望大佬指正
第一步:找到自己项目的本地文件:
在项目文件里点击自己的(Git bush here)唤醒控制台
第二步:初始化自己的git
输入git init
第三步:git config --global user.name 你的名字或者昵称 告诉gitee你是谁
第四部:git config --global user.email 你的邮箱地址
第五步:添加远程地址
输入git remote add origin 加上你的远程地址就是上图的HTTPS,如果你先前添加过,就会报错,remote origin
already exists.
但是这个问题不大,继续按照我的步奏走。
第六部:git remote -v 检查是否添加成功
第七步:上传代码
添加到缓存区
git add .
提交到本地仓库
git commit -m 备注信息
提交至远程仓库
git push origin master
我在推送的时候遇到了这个错 ,这是因为在项目文件的目录里没有和远程仓库的这两个文件匹配
所以只要把源项目的这两个文件删掉,再从新拉一遍即可
git pull --rebase origin master
然后再git push origin master,这里注意一下,如果你要推到自己的分支上去,要加上:自己的分支名
在克隆别人的代码时 记得如果不是拉master分支的话,就要加-b 后面加上分支名字
查看自己现在在那个分支?
git branch
创建分支
git checkout LD
git checkout的主要功能就是迁出一个分支的特定版本。默认是迁出分支的HEAD版本
git pull origin LD
从LD拉代码下来
git push origin LD -f
强推到指定分支上
如果在推或者拉代码的时候,发现需要密码和用户名,用户名大概率就是自己的邮箱
先将自己的代码推到commit那一步(目的:为了让自己 git init 床的本地仓库有一个本地的初始分支master git branch
可以查看),然后拉别人的代码就可以了。