linuxperson
asked on
git - conflict
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.
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.
ASKER
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:manocompute r/mysalt.g it (fetch)
origin git@github.com:manocompute r/mysalt.g it (push)
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:manocompute
origin git@github.com:manocompute
This thread was asking about "git - conflict", Your last post was a different question. Please post a new question for that post.
ASKER
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.
I want to make sure both should get approval from each other before commit.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.