Home > database >  How to push code to a new branch in github where i have been added as a collaborator
How to push code to a new branch in github where i have been added as a collaborator

Time:03-15

i am relatively new to git and facing some difficulty .I am an intern and the company i am working on has a git repository and they have added me as a collaborator .Now i have to to push the code to their repository by creating a new branch say "bytesBotsCode". I know how to create branches on my own repo and how to push and other basic functions but this i am facing some difficulty . Any help would be much appreciated .

Edit : The problem i was facing was There isn't anything to compare. Nothing to compare, branches are entirely different commit histories but it is solved by rebasing the project.

CodePudding user response:

If you create a locale branch and make changes to the code. You can commit those changes and push them. The branch will be pushed with the code. If you experience lack of git command line knowledge, you can install git helper tools like tower, fork or something of your own preference.

CodePudding user response:

  1. Clone the repository using "git clone <REPO_PATH>"
  2. Switch to destination branch using git "git checkout <BRANCH_NAME>"
  3. Create a branch from the destination branch using "git checkout -b <BRANCH_NAME>"
  4. Make Changes in code and add those changes in Staging by using "git add"
  5. Commit the changes to your branch "git commit -m "
  6. Push it to your remote branch "git push "
  7. Raise a pull request, you can refer GitHub or Bitbucket

Can you specify what difficulty you are facing?

  • Related