Solved

git - conflict

Posted on 2014-09-04
5
221 Views
Last Modified: 2014-11-14
I am trying to understand how git work with conflicts

i tried this test.

created a directory called test
cd test
git init
vi newfile (add "First")
git add .
git commit -m "first commit"
git checkout -b bri
switched to bri branch from master.
vi newfile(add "second" in the first line)
git commit -m "second commit")

Now when i tried to merge it didn't complain any conflicts. its updated the latest information on the first line.  This is not what i was expecting . I wanted to see the conflict information before it merges.
0
Comment
Question by:linuxperson
  • 3
  • 2
5 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 40305063
Hi linuxperson;

The Git Documentation and some resources can be found [here]. If you look at the link for Git Branching about the third link page in you will see information on using conflict.
0
 

Author Comment

by:linuxperson
ID: 40308608
In github site i do see a file with different symbol. It should be directory. How do i push my local directory to this github origin.  If you see pillar its look like a file but should be a directory with files. I am unable to click on the directory.

https://github.com/manocomputer/mysalt

Here is my situation.

[root@master salt]# ll
total 20
drwxr-xr-x. 2 root root 4096 Jun 29 12:44 dev
drwxr-xr-x. 2 root root 4096 Jun 30 19:23 pillar
drwxr-xr-x. 2 root root 4096 Jun  2 20:06 prod
-rw-r--r--. 1 root root  156 Jun 30 18:49 top.sls
drwxr-xr-x. 2 root root 4096 Jun 30 18:51 users


[root@master salt]# git remote -v
origin      git@github.com:manocomputer/mysalt.git (fetch)
origin      git@github.com:manocomputer/mysalt.git (push)
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 40309818
This thread was asking about "git - conflict", Your last post was a different question. Please post a new question for that post.
0
 

Author Comment

by:linuxperson
ID: 40382900
Here is my situation. I have two devops person who work with puppet and we are trying to share the code. at the same time i don't want one to overwrite other one's code. How do i setup git for this situation.

I want to make sure both should get approval from each other before commit.
0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 40383500
The way it works is that you create a git repository with some initial code and commit to the master branch. Now each programmer checks out the master and brings it into a new branch on his/her local system works in that branch until the current assignment is ready to be merged into the main branch, so programmer A creates branchA and programmer B creates branchB. The two programmers can not be working on the same code section because they will step all over each other. While each programmer is working on their own projects each of them can commit it the the git repository in their own branch not the main branch. When each of them has completed their current assignment and it is working the way they need it to be, it then can be merged into the main branch. The main branch should always be the most recent working code of the whole project.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question