2024年11月21日星期四 下午7:59:36

git Sharing your configuration on GitHub

2 年 前
#18758 引用
Troubleshooting

输入github的账号和密码,提示 鉴权失败

s

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.

fatal: 'https://github.com/xxxxxx/xxxxxx.git/' 鉴权失败

经过查找发现没有设置Personal access tokens

然后去setting里找Developer settings




在Developer settings里找access tokens



创建成功后会有个token,把它当作密码,在你重新推送你项目的时候,命令行提示你输入邮箱和密码的时候,把这个token当密码输入(复制即可)。

然后就推送完成了。

https://blog.csdn.net/qq_33320324/article/details/121893271


.错误:remote: Write access to repository not granted.

解决办法:重新在github网站上申请一个personal access token,具体申请方法可以百度,然后一定要勾选repo这个选项!!!有效期可以随意,我直接设置了永不失效。


原文链接:https://blog.csdn.net/doggege/article/details/124698914
0
2 年 前
#18781 引用
https

create a new repository on the command line

echo "# Home-AssistantConfig" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/freemsly/Home-AssistantConfig.git
git push -u origin main


push an existing repository from the command line

/data $ git version
git version 2.39.2



cd data

git init
pi@raspberrypi:/data $ git config --global user.name "mslycn"
pi@raspberrypi:/data $ git config --global user.email "[email protected]"

pi@raspberrypi:/data $ git config --global --add safe.directory /data
pi@raspberrypi:/data $ git remote add origin https://github.com/mslycn/Home-AssistantConfig20221103.git

git branch -M main

git clone https://mslycn:[email protected]/mslycn/homeassistant20221103.git




git remote add origin https://github.com/freemsly/Home-AssistantConfig.git
git branch -M main
git push -u origin main
0
2 年 前
#18782 引用
ssh

create a new repository on the command line

echo "# Home-AssistantConfig" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin [email protected]:freemsly/Home-AssistantConfig20221103.git
git push -u origin main


push an existing repository from the command line


git remote add origin [email protected]:freemsly/Home-AssistantConfig.git

#Link your local Git repository to the GitHub repository you created earlier.
git remote add origin https://github.com/mslycn/Home-AssistantConfig20221103.git
git branch -M main


git push -u origin main
0
2 年 前
#18783 引用
202405

git remote set-url origin https://username:[email protected]/repo.git

git remote set-url origin https://mslycn:[email protected]/repo.git

git clone https://github.com/mslycn/Home-AssistantConfig20221103.git
0
1 年 前
#18833 引用
GitHub Desktop
0
1 年 前
#18834 引用
1
0
1 年 前
#18835 引用
git回滚线上代码

https://www.cnblogs.com/kakawith/p/9550208.html
https://blog.csdn.net/qq_41261490/article/details/108119801
0
1 年 前
#18836 引用
[https ]Git push always asking username and password

You can solve this by the below command:

git remote set-url origin https://username:[email protected]/repo.git


Just replace the ‘username’ and ‘password’ with your credentials.

Even after doing so if you are getting the below error while trying to push:

“Error gnutls_handshake() failed: Handshake failed”

then check for the branch permission. no need to create new ssh.

if the error persists with the above set URL, check if there is any special chars in the username:password. if so then you need to URL encode them and use.



# git push -u origin main


fatal: 无法访问 'https://qq.com:[email protected]/freemsly/Home-AssistantConfig20221103.git/':URL using bad/illegal format or missing URL


s

git remote set-url origin https://username(not email):[email protected]/repo.git


change email to usrname run ok

0
1 年 前
#19989 引用
How to Fix Gitignore Not Working?

GitHub (or Git) can view every file in your working directory that categories the files into the following 3 types:

Tracked: These files are previously either committed or staged in history.
Untracked: These files haven’t been staged or committed previously.
Ignored: They are the files that can be set by users to ignore completely.


sudo git rm -r --cached ./homeassistant202405/home-assistant_v2.db






Untracked:表示是新文件,没有被git add过. 此文件在文件夹中, . 通过git add 状态变为Staged.

https://zhuanlan.zhihu.com/p/102890728
0
1 年 前
#19990 引用

step 1:查看https://github.com/freemsly/Home-AssistantConfig20221103/commits/main提交成功的日期

add GPSLogger integration


step 2:

git log



d16374d5c97755ff6e97a02cfb6ad9d3fb80e588

git reset --hard d16374d5c97755ff6e97a02cfb6ad9d3fb80e588

# git reset --hard d16374d5c97755ff6e97a02cfb6ad9d3fb80e588

output

HEAD 现在位于 d16374d add  GPSLogger integration



git rm -r --cached .
0