Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push to current branch not working for main branch #84

Open
Shah-Saumya opened this issue Dec 25, 2024 · 3 comments · May be fixed by #88
Open

push to current branch not working for main branch #84

Shah-Saumya opened this issue Dec 25, 2024 · 3 comments · May be fixed by #88

Comments

@Shah-Saumya
Copy link

  • I attempted to commit all the code to the main branch without creating a pull request, but instead, a new branch was created.
@siddharthkp
Copy link
Member

siddharthkp commented Dec 30, 2024

This definitely looks like a bug! Thanks for taking the time to report it, going to create an internal tracking issue for this as well!

(Tracking issue for github staff: https://github.com/github/copilot-workspace/issues/330)

@Raushang4
Copy link

> * I attempted to commit all the code to the main branch without creating a pull request, but instead, a new branch was created.

Understanding the Situation
Branch Creation:
When you create a new branch (e.g., using git checkout -b new-branch), you switch your working context to that branch. Any commits made afterward will go to this new branch, not the main branch.
Direct Commit vs. Pull Request:
Committing directly to the main branch means bypassing the pull request (PR) workflow, which is often used for code review and collaboration. If your repository settings do not enforce PRs, you can push directly to the main branch.

To commit your changes directly to the main branch, follow these steps:

Switch back to main branch: git checkout main 🛠️
Merge changes from new branch: If you want to incorporate changes from "new-branch", use git merge new-branch 🔄
Commit your changes: If there are uncommitted changes, add and commit them using git add . and git commit -m "Your commit message" 📝
Push changes to remote repository: Finally, push your changes using git push origin main 🚀

Raushang4 added a commit to Raushang4/copilot-workspace-user-manual that referenced this issue Jan 19, 2025
Fixes githubnext#84

Add a new section to the `responsible-ai-faq.md` file to address the issue of committing code to the main branch without creating a new branch.

* Add a new section titled "Is it possible to commit all code to the main branch without creating a new branch?"
* Update the implementation to allow direct commits to the main branch from the Copilot Workspace interface
* Provide an explanation that users can now choose to commit changes directly to the main branch

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/githubnext/copilot-workspace-user-manual/issues/84?shareId=XXXX-XXXX-XXXX-XXXX).
@Raushang4 Raushang4 linked a pull request Jan 19, 2025 that will close this issue
@dylanatsmith
Copy link

This is still ongoing. Should we remove the push options from the menu since they don’t function properly? At least until we have a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants