githubschool / vroom

Let's learn about Git and GitHub
https://githubschool.github.io/vroom/
MIT License
0 stars 0 forks source link

Parking Lot #7

Open githubteacher opened 3 years ago

githubteacher commented 3 years ago

Post any questions you may have here during the training.

ericalloyd commented 3 years ago

🎥 Recordings will be posted here

Monday, Oct. 26 - Friday, Oct. 30, 2020

Day 1

Link: https://github.zoom.us/rec/share/dTeLBjBT2pU9uSLBv-aHvlgA0HfWnLoa_LfOj8fPRvya7WBHhcW_XoWpf4hMGLK0.ocDz8u8tmaRn2HBv Passcode: xZeC8*8Z

Day 2

Link: https://github.zoom.us/rec/share/wbrLEYb8oXjfNnjbe2z_SehfnlH78XqEj8QXCEgcmkvToaZqoxrvsINKIvZCJlAG.QnaXDp03pF0qsLoT Passcode: 10u07D%7

Day 3

Link: https://github.zoom.us/rec/share/Oi10Ad1zEm_W_5Tcbw6uzxI-obL6d9lPCWUiAdx5_ehsd6rzHfPk0F7uQyoixS-Z.AeeLvNMxI0DfZjwJ Passcode: .Q93s22+

Day 4

Link: https://github.zoom.us/rec/share/MWBrEq45AurSEnmUcQtYKx1cRwpxzYSQRF58jyL7scBUx-6Cqiyv8CAP8joyirBJ.jCRHrcPId_IwpGZk Passcode: Wj=Zcd%8

Day 5

Link: https://github.zoom.us/rec/share/vQHSbGaRdCY48EhOb32X4oe94d7jUBSMj5z2nQwwb_2NMNTnxzch6irlJ87t2A8.RJ8trG6-MZJ9Im5t Passcode: cY5tR9#@

ericalloyd commented 3 years ago

Discussions

ericalloyd commented 3 years ago

Note: Branches are recoverable indefinitely in the UI via the Pull Request that references it. This question specifically asked how configure that recovery time to be shorter

Branch recovery is tied to Pull Requests, which are stored in refs/pull.

refs refers to the reflog, which keeps track of where the tips of branches are located at any given time. Read more about reflog and options here: git docs - reflog.

By default, the local reflog expiration date is set to 90 days. An alternate expire time can be specified by passing a command line argument --expire=time to git reflog expire or by setting a git configuration name of gc.reflogExpire.

An "expire time" other than the default can be manually specified by passing a command line argument --expire=time to git reflog expire. If this option is not specified, the expiration time is taken from the configuration setting gc.reflogExpire, which in turn defaults to 90 days.

⇒ git reflog expire --expire=1.day          

git reflog expire --all prunes entries regardless of their age;

The references for pull requests are namespaced under refs/pull/<pull request number>/. The head reference points at the tip of the branch that's being pull requested, i.e. the last commit on the branch.

⇒ git ls-remote | grep pull
From git@github.com:<username>/<remote>.git
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa        refs/pull/1/head
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb        refs/pull/1/merge
cccccccccccccccccccccccccccccccccccccccc        refs/pull/2/head
dddddddddddddddddddddddddddddddddddddddd        refs/pull/2/merge
ericalloyd commented 3 years ago

Files that have not changed between commits are referenced with pointers. This helps branches remain lightweight, even though each commit contains a snapshot of the entire project at that point in time.

Screen Shot 2020-10-28 at 7 50 16 AM
ericalloyd commented 3 years ago

You can do this using git diff to compare your remote and local branches. What you'll see is the comparison of what is currently committed in your local repo, vs. what the origin or remote branch shows.

git diff <remote-branch> <local-branch>

⇒  git diff origin/master master

diff --git a/_posts/0000-01-06-ericalloyd.md b/_posts/0000-01-06-ericalloyd.md
index 4d11440..f4f0583 100644
--- a/_posts/0000-01-06-ericalloyd.md
+++ b/_posts/0000-01-06-ericalloyd.md
@@ -3,7 +3,7 @@ layout: slide
 title: "Welcome to our slide deck!"
 ---

-Caption here
+Yo

 ![riddlocat](https://octodex.github.com/images/riddlocat.png)
 {: .center}
ericalloyd commented 3 years ago
AirSeven commented 3 years ago

Problem/Challenge:

During the set up of some of our repos we encountered an error regarding too long filenames:

git_filename_too_long

Solution approaches:

  1. We were able to fix this with the following git bash command on the respective PCs: a. On your PC open git bash b. Enter the command git config --global core.longpaths true and hit return_

  2. You might also want to enable Windows long path support, too.

Question:

Is that the best way to fix the error or are there better/more efficient solutions?

Answer:

Yes, setting the git config is a good solution

git config --system core.longpaths true
ericalloyd commented 3 years ago

The syntax used is fnmatch, not regular expressions. Rules are similar to shell filename globbing. Ex: * Matches any file. Can be restricted by other values in the glob. Equivalent to / .* /x in regexp.

Configuring branch protections

ericalloyd commented 3 years ago

Feedback: Training Manual does not include code review process (Suggested Changes, Code Review Process)

TODO:

ericalloyd commented 3 years ago

Feedback/Feature:

TODO:

AirSeven commented 3 years ago

Problem/Challenge:

Need jump start in scripting multiple git commands to create often used helper scripts,e.g., reading out all Tags of all currently checked out Submodules of a repo.

Question:

Do you have aleeady proven in use helper files for day-by-day git business?

Answer:

Apologies! I didn't see this question during our call today.

Here are some examples of bash scripts used at GitHub, where multiple git commands are being chained together: github/platform-samples/scripts

ericalloyd commented 3 years ago

Feedback from @AirSeven : Doesn't like GitHub's network graph, prefers ClearCase's viz Prefers the style with bubbles going from top to bottom, have a clear view of all branches, with tags beneath the bubbles Need simple view, with data immediately viewable, see the commit data plus the most recent tags

TODO:

ericalloyd commented 3 years ago

GitHub's 2 main centers are US-based (can't share exact locations). Some static content is served via CDN from global locations.

ericalloyd commented 3 years ago

From git docs - Working With Remotes:

$ git remote
origin
$ git remote add pb https://github.com/paulboone/ticgit
$ git remote -v
origin  https://github.com/schacon/ticgit (fetch)
origin  https://github.com/schacon/ticgit (push)
pb  https://github.com/paulboone/ticgit (fetch)
pb  https://github.com/paulboone/ticgit (push)

Now you can use the string pb on the command line in lieu of the whole URL. For example, if you want to fetch all the information that Paul has but that you don’t yet have in your repository, you can run git fetch pb:

$ git fetch pb
remote: Counting objects: 43, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 43 (delta 10), reused 31 (delta 5)
Unpacking objects: 100% (43/43), done.
From https://github.com/paulboone/ticgit
 * [new branch]      master     -> pb/master
 * [new branch]      ticgit     -> pb/ticgit

Paul’s master branch is now accessible locally as pb/master — you can merge it into one of your branches, or you can check out a local branch at that point if you want to inspect it.

To set separate urls for fetching and pushing, use set-url with a --push or --fetch option. Ex:

git remote set-url --push repo-3 https://github.com/lalaland/repo-3
ericalloyd commented 3 years ago

Git Flow

git-flow

Backport Flow

backport-flow
OliverLangenFord commented 3 years ago
ericalloyd commented 3 years ago
ericalloyd commented 3 years ago
OliverLangenFord commented 3 years ago
OliverLangenFord commented 3 years ago
Zisse commented 3 years ago

Getting to need "push --force" by rebasing: