2024年5月15日 1:12:55

git Sharing your configuration on GitHub

1 年 前
#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

0
1 年 前
#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

git remote add origin https://github.com/freemsly/Home-AssistantConfig.git
git branch -M main
git push -u origin main
0
1 年 前
#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
git branch -M main
git push -u origin main
0
1 年 前
#18783 引用
1
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.



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