git - 我如何在新的远程分支上使用 git push?
问题描述
我有一个默认创建的第一个主分支。
我签出一个名为“prd”的新分支,我希望它推送到远程源,但在新分支上。
我试着做:
$ git push -u origin/prd prd
但是控制台记录了:
fatal: 'origin/prd' does not appear to be a git repository
fatal: Could not read from remote repository.
有人可以帮我吗?
解决方案
# Create a new branch:
git checkout -b branch_name
# Edit, add and commit your files.
# Push your branch to the remote repository:
git push -u origin branch_name
这应该有效。
推荐阅读
- javascript - 如何在不重新加载页面的情况下提交带有两个 HTML 按钮的表单?
- java - Android:无法访问 android.os.AsyncTask.WorkRunnable
- r - 如何构造 for 和 if 循环来构造拉丁方格?
- microsoft-graph-api - Microsoft Graph API OneNote 页面内容 BadRequest
- python - 非常简单的字符串加密
- r - 如果 rows 具有相似的元素,则保留较短的行
- python - 类中的Python模拟迭代器函数
- python - 如何从数据框中删除具有空值和分类变量的行?
- html - 如何不将border-right应用于div-CSS的最后一个孩子
- javascript - 我无法让 $set 运算符在特定字段上工作