![](/img/trans.png)
[英]Copy a directory and all its files from the master branch into a new branch with a different directory structure
[英]copy files from master to new branch
我一直在為客戶做一個項目。 客戶現在要求我上傳我在他們的 github 帳戶上工作的內容。 我不想更改他們的設置,我想創建一個新分支。 在我的本地機器上,我做了以下事情。 當我執行 git 狀態時,我得到工作樹是干凈的。 如何將所有文件從 master 推送到 devBranch 以便能夠只上傳這個分支而不干擾客戶的 master 分支?
git add.
git branch dev_branch
git checkout dev_branch
我在您的序列中沒有看到git commit
。
通常的方法是:
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
如果您無權回推到原始存儲庫,那么您需要先分叉它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.