Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

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

To https://github.com/Baharul1/testRepo.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/Baharul1/testRepo.git'
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.

 

4. 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.

 

Thanks

Baharul Islam

 

1 Reply
Moderator
Message 2 of 2

Re: Git commit from local Repo

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 :)

 

https://guides.github.com/introduction/flow/

 

 

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 https://lab.github.com

 

Let us know how it goes :)