I am new to Git. I have a public repo on GitHub and me & my friend need to work on the project simultaneously. We are using Netbeans 7.1 which has built in Git features. I can clone from and submit to GitHub but for example consider we have the following structure:
- A.java
- B.java
-
C.java
- If User #1 changes A.java and User #2 changes B.java, how do we merge them?
- If User #1 and User #2 both changes C.java, what happens?
There is remote/Fetch & Remote/Pull and I cannot understand the difference. We will work on the school project as 4 people and we want to also learn version controlling.
git fetchfetches changes from the remote git repo but doesn’t change you’re local branches tracking the remote changes. Git pull is agit fetchfollowed by agit mergeon your local copy.Generally I do
Merges will be done just like any other SCM. If conflicts arise you’ll be given a chance to edit/fix them and then you’d have to push the changes to the remote repo for others to see. Users could also edit the same file and the changes won’t result in a conflict and will just merge.