Branch remote (need help)

Hello everybody,
currently for a project school we have created a repository with 9 branch (main + Projet1 to Projet8).

In my side I am only allowed to work on the Project6 branch, from Project6 branch I must create a new branch “FirstName-Lastname” to work there locally (git add, commit so on…) and then push my code on the remote repository.

I don’t what is wrong but it doesn’t work, I added a screenshot about what I did from “git clone to git pull”, plz could you tell me if something is wrong in my process or if the owner of the repo forgot to give me some rights?

Thank you for your help.

If the remote repository isn’t owned by you and you’re supposed to push to there directly then yes, the owner needs to add you as a collaborator.

However it’s common procedure to not do that, instead you could create a fork (a copy of the repository owned by you), push to there, and then create a “pull request” (PR) to the origin repository to have your changes included there.

It’s up to you and the people you’re working with to decide which concept you want to use. A high-level overview is here: About collaborative development models - GitHub Docs

1 Like

Thanks for your reply, I have to discuss with the rest of the team about these two way of work.

Btw could you confirm plz, if the owner add me as collaborator the process used in my screenshot is correct to create a new branch from the existing branch projet6, add the modification on this new branch (firstname-lastname) and finally push the modification on the remote repo by reflecting the changes only on the branch Projet6 ?

Thanks :pray:

The last command in the screenshot should work, yes. :slightly_smiling_face:

That said, changing the branch name locally seems unnecessarily complex to me, because the branch you use locally doesn’t matter to the remote repository at all. Only the remote branch you push to matters.

1 Like

Oki thank you for your time :rocket::rocket::rocket:

1 Like

thanks for the info.