Git commit from local Repo

Hi All,

I am trying to commit from two different repo with below scenerio…

  1. Have created some files in gitHub in “master” branch
  2. Created two local repo as Repo1 and Repo2 and pull from master branch form git.
  3. Make changes in both the Repo in local but when trying to push the changes from Repo one by one getting error as

! [rejected] master -> master (fetch first)
error: failed to push some refs to ‘
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push --help’ for details.

  1. When trying to make sync both the local Repo from gitHub using pull …getting error as

error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use ‘git add/rm <file>’
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.

Can anyone please help how to make this set-up . We are not allowed to make changes in same branch?

What is the ideal project set-up. like first pull from central Repo and then create Branch in localRepo & make changes. Then merge to central repo or when to merge.


Baharul Islam

Hi @baharul1

I looked at your steps and I could not figure out the workflow or project requirement for your tasks. Thus I would like to direct you to this link where it explains about the GitHub Flow and it could be something that is worth considering :slight_smile:

As for the errors when you pull changes from a remote, do ensure that there are not conflicting files in your local working directory. If there are conflicts you will need to resolve them. There are a series of courses to help you get started in here

Let us know how it goes :slight_smile: