Solved

git - conflict

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

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 63

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 63

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
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 …
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 …

820 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