Code Repo Hygiene for Agile Teams Flashcards
What is the Two Pizza Team
The number of people you can feed with two pizzas is the perfect amount of people for a team. Jeff Bezos
What are CVS, Subversion, & Git?
Have multiple versions of a file and you can usually merge. Concurrent Version System. Subversion made easy to work remotely. Single master repo. Then We have Git?
What is a Merge Conflict?
Repository with some file That is the remote. There is no true remote that is golden, but treat the github repo as the golden one.
A clones to the repo
B Pushed changes
A pushes changes, gets a merge error. Then A has to merge the errors and then push the changes.
What is a git hub Commit?
Really refers to a whole tree. And it refers to the tree structure. In early versions it was just the diff, but that is no longer the case.
Contains:
40 digit hex hash (SHA-1) that is unique to the UNIVERSE. I have the state of the tree at this time, tell me the difference between state of the tree at another time using git diff.
What are Git commands like HEAD, ORIG_HEAD, HEAD_'n', 770dfb-2, "master@{01-Sep-2012}" ?
HEAD is the most recently committed version on current branch.
ORIG_HEAD is the right after a marge, points to the pre-merged version.
HEAD_n is the nth previous commit.
770dfb~2 is 2 commits before 770dfb.
“master@{01-Sep-2012}” : last commit on master branch prior to this date
What is Git Pull?
Get the most recent copy of an entire repo and all the history on that repo. Then it merges with the code in your repository. It is 2 steps in one.
If it ever exists in some commit, then you can get that in the repository.
Why should you always commit?
You always have a clean way to get the previous values. You can also see the previous versions of files. You can rollback changes really easily. You should commit very often.
If you try to push to a remote and get a “non-forward (error): failed to push some refs”, which statement is FALSE?
a. Some commits present at remote are not present on your local repo.
b. You need to do a merge/pull before you can complete the push
c. Your local repo is out-of-date with respect to the remote
d. You need to manually fix merge conflicts in one or more files
You don’t need to manually fix merge conflicts. d.
What are branches in Git?
Multiple versions of the code in the same repo that let you keep the versions separate. You create a new branch and those branches have its own commit history. You can then merge commits here to master. Then the commits in your branch go to master.
Create Branch for new features
Use Branch only for changes needed for this feature. If you find other stuff, then use a new branch. Then you can delete branches.
Commits per branch should be small since you make small amounts of changes per branch.
What is the difference between fork and clone?
Fork is a clone only on the server side. You can make changes, but you have to get permission from the owner to do so. Fork is so that people can use your code and make changes, but they can’t change your actual repository, they have to submit a pull request first.
What is git rebase?
This is when you have changes on your master branch. You can rebase to the latest version of master and then do a merge conflict locally before you merge with master. Then you know you won’t get merge conflicts.
What is git cherry-pick?
You can specify certain commits from a branch when you are merging.
Why would you not have master be the deployed version?
You can cherry pick the features from the deployed version you want in the master when people are developing.
If separate teams are assigned to work on release bug fixes and new features, then you need to use what git model?
Branch per release & Branch per feature.
What is the process by which you discover a bug?
They all say that “if there is not a test for it, then you have not found the bug”.