1

I am using one open source project which is hosted on git-hub.

I am also making lots of changes in this project at my end and keeping this in my another local repository.

So when i need to fetch new changes from git-hub I am facing issues in merging both (changes of my local repository and the git-hub)

For example : project 1 -> local1 also from github : project 1 -> git-1 **these changes are on same directory. Currently i am merging these two in below steps:

  1. Replace the local repository code with git3 (now tree is project1->git1)
  2. compare it with head (which is project1->local1)
  3. Update the local1 changes (head is now project1->local1->git1-local merge)

but in case of any new update from git-hub (say now tree is project1->git1->git-2) and new update in my local (project1->local1->local2) .if i now go for merging of these two ,i have to again repeat (again add the changes of local1) . i am fine if somehow i can only add the changes of local2.

I hope i am clear in what i am trying to say.

CharlesB
  • 86,532
  • 28
  • 194
  • 218
gsagrawal
  • 2,900
  • 4
  • 27
  • 27
  • Do you mean you do 1. and 2. manually? if not please use git vocabulary (checkout, etc), it's better to understand. Same thing for "add the change" – CharlesB Apr 18 '12 at 08:56
  • yes these are the manual things i am doing here.but here compare is git compare. Also add the changes means .. yes manually add the changes. – gsagrawal Apr 18 '12 at 09:51
  • 1
    First of all what is git3 its just in the 1. step use branches while adding new features but I really don't understand your situation if you could write it a bit clearer try using git commands instead of verbal explaination. – Learath2 Apr 18 '12 at 10:12

1 Answers1

1

Doing things manually is really difficult, you're making the task complex and error-prone.

Git can help you with this, by designating states of remote repositories with referencs, like origin/branch, origin/master, etc.

See commands such as git merge origin/branch, git chekout branch, and stuff like this. You don't need different working copies, nor manually moving stuff between directories. Git handles it for you when switching different branches.

CharlesB
  • 86,532
  • 28
  • 194
  • 218