如何将我的更改推回到git中的源代码
我在github中创建了一个项目,然后在这个项目上进行了git克隆,以便将所有源代码都放到我的机器上 我对源代码做了一些修改,我的问题是:-如何将我的更改推回到git中的源代码,git,github,git-push,Git,Github,Git Push,我在github中创建了一个项目,然后在这个项目上进行了git克隆,以便将所有源代码都放到我的机器上 我对源代码做了一些修改,我的问题是:- 如何将我的更改提交到本地git存储库以及github中的分叉存储库 原始源代码的作者将如何从github中的分叉存储库中提取我的更改 检查此项 如何将我的更改提交到本地git存储库 git提交-m“您的消息” 如何在github的分叉存储库中提交我的更改? 原始源代码的作者将如何从github中的分叉存储库中提取我的更改 如何将我的更改提交到本
如何将我的更改提交到本地git存储库
git提交-m“您的消息”
如何在github的分叉存储库中提交我的更改?
原始源代码的作者将如何从github中的分叉存储库中提取我的更改
git add .
然后,通过
git commit
一旦进行了本地提交,就可以将其推送到远程GitHub fork
git push
- 以下是简单的方法:
- git添加
- git提交-m“最终更改”
- git远程添加源url(在url中添加存储库的地址)
- git远程-v
- git-push-f
- git推送源主机
Repo->Settings->Deploy key
)
因此,在我git clone
my repo之后,我必须手动更改(或使用git remote
添加新的)以下内容
发件人:
致:
然后我确保在ssh add-l
(代理)中找到了我的密钥,然后我
git push
我在git add操作中错误地添加了某些不需要的文件,如何回复说我不想添加几个文件使用“git reset HEAD…”从提交中删除文件。
follow these steps:
git init (To initialize the repository as git)
git add .( To add the changes to staging area)
git commit -m "this is my first commit" ( Initialize it as a commit with the message)
git add remote origin url (in url add the address of your repository)
git pull origin master(to pull all the commits first otherwise they would be overridden)
git -f push origin master(force push the chances to remote in the branch named master)
[remote "origin"]
url = https://github.com/USERNAME/REPOSITORY.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "origin"]
url = git@github.com:USERNAME/REPOSITORY.git
fetch = +refs/heads/*:refs/remotes/origin/*