Solved

git - conflict

Posted on 2014-09-04
5
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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.
A short article about problems I had with the new location API and permissions in Marshmallow
Six Sigma Control Plans
Progress

687 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