[英]copy files from master to new branch
I have been working on a project for a customer.我一直在为客户做一个项目。 The customer is now asking me to upload the stuff I am working on their github account.
客户现在要求我上传我在他们的 github 帐户上工作的内容。 I dont want to change their setup, I would like to create a new branch.
我不想更改他们的设置,我想创建一个新分支。 On my local machine I have done the following.
在我的本地机器上,我做了以下事情。 When I do a git status I get that working tree is clean.
当我执行 git 状态时,我得到工作树是干净的。 How can I push all the files from master to devBranch to be able to upload just this branch and not interfere with the customer's master branch?
如何将所有文件从 master 推送到 devBranch 以便能够只上传这个分支而不干扰客户的 master 分支?
git add.
git branch dev_branch
git checkout dev_branch
I don't see a git commit
in your sequence.我在您的序列中没有看到
git commit
。
The usual way is:通常的方法是:
cd /path/to/local/repo
git switch -c new_branch master
# work
git add .
git commit -m "New work on new branch"
git push -u origin new_branch
If you don't have the right to push back to the original repository, then you would need to fork it first .如果您无权回推到原始存储库,那么您需要先分叉它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.