Question

In: Computer Science

I. At the beginning, create a folder named "test" and add the folder into the version...

I. At the beginning, create a folder named "test" and add the folder into the version control tool tracking system. Then create one file named "001" under this folder. Commit any change if necessary.

II. Next, add another file named "002" in the same folder and commit the change ("adding") in the version control tool.

III. Followed by adding that file, create a branch (namely, "branch-A") in the version control tool and make some changes to the contents in file "001" under the newly created branch. Then commit the change from file "001".

IV. Create another branch (namely, "branch-B") from the main branch (NOT from "branch-A"!) in the version control tool and make some changes to the contents in file "002". Then commit the change from file "002".

V. The next step is to merge "branch-A" and "branch-B" and commit the change to the main branch. Record what you see from such an operation and make your own decision which version you want to keep.

VI. At last, Revise the current change from the merged result to the beginning where there was one file named "001". Record what you see from this operation.

(3) Show a graph of all version related operations from version control tool. The graph is used to visually depict how changes are made.

Solutions

Expert Solution

I. At the beginning, create a folder named "test" and add the folder into the version control tool tracking system. Then create one file named "001" under this folder. Commit any change if necessary.

mkdir test 
cd test
git init
touch 001
echo "Commit this" >> 001 
git add .
git commit -m "changes added"

II. Next, add another file named "002" in the same folder and commit the change ("adding") in the version control tool.

touch 002
echo "adding" >> 002
git add .
git commit -m "changes added"

III. Followed by adding that file, create a branch (namely, "branch-A") in the version control tool and make some changes to the contents in file "001" under the newly created branch. Then commit the change from file "001".

git checkout -b branch-A
git add .
git commit -m "branch A changes"

IV. Create another branch (namely, "branch-B") from the main branch (NOT from "branch-A"!) in the version control tool and make some changes to the contents in file "002". Then commit the change from file "002".

git checkout master
git checkout -b branch-B
echo "new changes in B" >> 002
git add .
git commit -m "branch B changes"

V. The next step is to merge "branch-A" and "branch-B" and commit the change to the main branch. Record what you see from such an operation and make your own decision which version you want to keep.

git checkout master
git merge branch-A
git merge branch-B

VI. At last, Revise the current change from the merged result to the beginning where there was one file named "001". Record what you see from this operation.

git log
git status

(3) Show a graph of all version related operations from version control tool. The graph is used to visually depict how changes are made.

git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all

Please upvote the solution, comment in case of any doubts


Related Solutions

Objectives: 1. Create classes to model objects Instructions: 1. Create a new folder named Lab6 and...
Objectives: 1. Create classes to model objects Instructions: 1. Create a new folder named Lab6 and save all your files for this lab into this new folder. 2. You can use any IDE (such as SciTE, NetBeans or Eclipse) or any online site (such as repl.it or onlinegdb.com) to develop your Java programs 3. All your programs must have good internal documentation. For information on internal documentation, refer to the lab guide. Problems [30 marks] Problem 1: The Account class...
Objectives: 1. Create classes to model objects Instructions: 1. Create a new folder named Lab6 and...
Objectives: 1. Create classes to model objects Instructions: 1. Create a new folder named Lab6 and save all your files for this lab into this new folder. 2. You can use any IDE (such as SciTE, NetBeans or Eclipse) or any online site (such as repl.it or onlinegdb.com) to develop your Java programs 3. All your programs must have good internal documentation. For information on internal documentation, refer to the lab guide. Problem : The Fraction class (Filename: TestFraction.java) Design...
In the root of the project create a folder called res. In that folder create a...
In the root of the project create a folder called res. In that folder create a file called DemoFile.txt Create a class with a static main that tests the ability to resolve and print a Path: Create an instance of a FileSystem class. Create an instance of the Path interface for the DemoFile.txt file. Print the constructed Path with System.out.println() method. Create a class that does the following: Using a pre-Java 7 solution, create a class that tests streams in...
JAVA There is a folder named Recursive folder at the same location as these below files,...
JAVA There is a folder named Recursive folder at the same location as these below files, which contains files and folders. I have read the data of the Recursive folder and stored in a variable. Now they are required to be encrypted and decrypted. You may copy past the files to three different files and see the output. I am confused on how to write code for encrypt() and decrypt() The names of files and folders are stored in one...
Inside “Lab1” folder, create a project named “Lab1Ex3”. Use this project to develop a C++ program...
Inside “Lab1” folder, create a project named “Lab1Ex3”. Use this project to develop a C++ program that performs the following:  Define a function called “Find_Min” that takes an array, and array size and return the minimum value on the array.  Define a function called “Find_Max” that takes an array, and array size and return the maximum value on the array.  Define a function called “Count_Mark” that takes an array, array size, and an integer value (mark) and...
Inside “Lab1”folder, create a project named “Lab1Ex1”. Use this project to write and run a C++...
Inside “Lab1”folder, create a project named “Lab1Ex1”. Use this project to write and run a C++ program that produces:  Define a constant value called MAX_SIZE with value of 10.  Define an array of integers called Class_Marks with MAX_SIZE which contains students Mark. Define a function called “Fill_Array” that takes an array, and array size as parameters. The function fills the odd index of the array randomly in the range of [50- 100] and fills the even index of...
Using NetBeans, create a Java project named FruitBasket. Set the project location to your own folder....
Using NetBeans, create a Java project named FruitBasket. Set the project location to your own folder. 3. Import Scanner and Stacks from the java.util package. 4. Create a Stack object named basket. 5. The output shall: 5.1.Ask the user to input the number of fruits s/he would like to catch. 5.2.Ask the user to choose a fruit to catch by pressing A for apple, O for orange, M for mango, or G for guava. 5.3.Display all the fruits that the...
Create a new folder called CSCI130_A3_yourname. Create all of the files indicated below within this folder....
Create a new folder called CSCI130_A3_yourname. Create all of the files indicated below within this folder. For this assignment you will be creating a total of 2 classes that meet the definitions below. This assignment will allow the user to enter in the coefficients for a polynomial function of degree 2. The user will then be asked to enter a number. The program will use that number as an argument to the function, and will print the corresponding function value....
11.1 Simple Arithmetic Program Using the instructions from Week 1 Lab, create a new folder named...
11.1 Simple Arithmetic Program Using the instructions from Week 1 Lab, create a new folder named Project01. In this folder create a new class named Project01. This class must be in the default package. Make sure that in the comments at the top of the Java program you put your name and today's date using the format for Java comments given in the Week 1 Lab. For this lab, you will write a Java program to prompt the user to...
TrackMinMax i want the generic version based on java For this lab, you will create a...
TrackMinMax i want the generic version based on java For this lab, you will create a generic version of the IntTrackMinMax class you wrote in a previous lab, called TrackMinMax. The API is: Function Signature Description constructor TrackMinMax() constructor check void check(T i) compares i to the current minimum and maximum values and updates them accordingly getMin T getMin() returns the minimum value provided to check() so far getMax T getMax() returns the maximum value provided to check() so far...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT