- git config --global user.name "Sergey Denisov"
- git config --global user.email "sergeant.wssa@gmail.com"
- mkdir git
- cd git
- mkdir repA
- cd repA
- git init
- echo > fileA.txt
- echo > fileB.txt
- git add .
- git commit -m "1st commit with some files (file A, file B)"
- git checkout -b branch1
- cd ..
- git clone -b branch1 repA repB
- cd repB
- echo > fileC.txt
- git add fileC.txt
- git commit -m "2nd commit containing new file (file C)"
- cd ../repA
- git checkout master
- cd ../repB
- git push origin branch1
- cd ../repA
- git checkout branch1
- open -a TextEdit fileC.txt # (modifying line#1 of file C to "line#1A")
- git commit -a -m "3rd commit with modified line#1 of file C"
- cd ../repB
- open -a TextEdit fileC.txt # (modifying line#1 of file C to "line#1B”)
- git commit -a -m "4th commit with modified line#1 of file C"
- git fetch origin
- git merge origin/branch1
- git checkout --theirs fileC.txt
- git add fileC.txt
- git commit -m "5rd commit with resolving conflict using theirs file"
- cd ../repA
- git remote add origin ../repB
- git fetch origin
- git merge origin/branch1
- git remote rm origin
- git remote add origin git@github.com:sergdenisov/repA.git
- git push --all origin
- cd ../repB
- git remote rm origin
- git remote add origin git@github.com:sergdenisov/repB.git
- git push --all origin
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|