[英]How to push my changes back to the source code in git
我在github中创建了一个项目,然后对这个项目进行了git 克隆,以将所有源代码下载到我的机器上。
我对源代码做了一些修改,我的问题是:-
- 如何将我的更改提交到本地 git 存储库以及 github 中的分叉存储库?
要为提交添加文件更改,请使用以下命令。
git add .
然后,通过
git commit
进行本地提交后,您可以将其推送到远程 GitHub 分支。
git push
- 原始源代码的作者将如何从 github 中的分叉存储库中提取我的更改
要使您的源代码被原始 fork 拉取,您必须向项目所有者发送拉取请求。
检查这个
使用 GIT,我如何有选择地从另一个“叉子”中提取/合并更改?
How to commit my changes to the local git repository
git commit -m "Your Message"
How to commit my changes in forked repository in github?
http://www.backdrifter.com/2011/02/09/working-on-forked-projects-using-github/
http://help.github.com/fork-a-repo/
How will the author of the original source code, pull my changes from the forked repository in github
如何显示已上演的更改?
http://www.kernel.org/pub/software/scm/git/docs/git-pull.html
http://www.kernel.org/pub/software/scm/git/docs/everyday.html
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)
我正在使用已部署的密钥( ssh )与 http 和用户/通行证( Repo -> Settings -> Deploy Keys
)
因此,在我git clone
我的仓库后,我必须手动更改(或使用git remote
添加新的)以下内容:
[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/*
然后我确保在ssh-add -l
( agent ) 中找到了我的密钥,然后我只是git push
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.