简体   繁体   English

将文件从 master 复制到新分支

[英]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.

相关问题 将一个目录及其所有文件从 master 分支复制到具有不同目录结构的新分支中 - Copy a directory and all its files from the master branch into a new branch with a different directory structure git copy [branch]中的文件,并粘贴到其他[branch or master]下 - git copy Files from [branch] and paste at under other [branch or master] 除了特定的提交,如何将提交从master复制到新分支? - How to copy commits to a new branch from master, except specific commits? 将所有文件从master复制到git中的另一个分支 - Copy all files from master to another branch in git 如何从一个分支复制到另一个分支 - 文件要掌握? - How to copy from one branch to another - Files going to master? 将文件从master复制到orphan分支而不应对修订 - copy files from master to orphan branch without coping the revisions 如何通过丢弃所有更改来将所有更改从远程源主分支复制到本地的新分支 - How to copy all changes from the remote origin master branch to a new branch on local by discarding all changes of it Master或当前Dev分支中的新分支 - New branch from Master or current Dev branch 是否可以创建一个作为主分支文件副本的分支进行测试? - Is it possible to create a branch that is a copy of master branch files for testing? 搞砸了分支,旧的master分支显示了新分支中的文件? - Messing up with branches, old master branch shows files from the new branch?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM