Solved

git - conflict

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Batch file output 20 77
wordmultiple challenge 12 90
listing all functions in JavaScript 19 105
How can i compile this github project?? 2 42
Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
A short article about problems I had with the new location API and permissions in Marshmallow
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

706 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

16 Experts available now in Live!

Get 1:1 Help Now