Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

GIT Questions You work for a software company, and before you leave to go home y

ID: 3791735 • Letter: G

Question

GIT Questions

You work for a software company, and before you leave to go home you pushed your latest code to the remote repository. Assuming there were people still working and pushing code to the remote repository after you leave, what single git command do you need to enter in order to update your local repository (on the master branch) when you return in the morning? What are the three steps of the git workflow to perform when you have a new file you want to include as part of your repository? True or False. Your code on your local repository is visible to other programmers. True or False. Only you can access the branches that you created in the remote repository. Charly and Danny are working in parallel on a coding project from different computers, but sharing the same remote repository. Charly just changed several files and performed a 'git commit' in his working directory. Danny then performs a 'git puli'. Can Danny see the changes that Charly did? Explain your reasonings. While programming in java, whenever you compile your code you create a massive amount of ".class" files. You want your repository to be as maintained and clean as possible, so you want to avoid ".class" files being added to your repository, while ensuring your 'git status' will not consider them when displaying files to be added or comitted. What file do you need to edit? What is the one line you need to add to that file to ignore all the ".class" files?

Explanation / Answer

1.

1. You work for a software company, and before you leave to go home you pushed your latest
code to the remote repository. Assuming there were people still working and pushing code to
the remote repository after you leave, what single git command do you need to enter in order to
update your local repository (on the master branch) when you return in the morning?
git pull origin branch_Name

2. What are the three steps of the git workflow to perform when you have a new file you want to
include as part of your repository?
1. git add .   //Adds the file to your local repository and stages it for commit.
2. git commit -m fileName //Commits the changes in your local repository.
3. git push origin branch_Name //Pushes the changes from local repository to git hub.

3. Your code on your local repository is visible to other programmers. False. Unless you push the changes to the git hub, they are not visible to others.

4. Only you can access the branches that you created in the remote repository. False.

5. Charly and Danny are working in parallel on a coding project from different computers, but
sharing the same remote repository. Charly just changed several files and performed a git
commit in his working directory. Danny then performs a git pull. Can Danny see the changes
that Charly did? Explain your reasonings.
Simply speaking No. There will be three repositories in this perspective. 1. Local to Charly.
2. Local to Danny. 3. Remote/central repository.
A local to charly repository if not pushed, even a commit will not be sent to the shared
repository, and therefore, will not be seen by everybody else.