Solved

git - conflict

Posted on 2014-09-04
5
219 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
python question 5 69
What is Python programming? 3 103
autoit - check if option is checked in another program 2 108
advertisement module in core php 4 144
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now