Open githubteacher opened 3 years ago
Monday, Oct. 26 - Friday, Oct. 30, 2020
Link: https://github.zoom.us/rec/share/dTeLBjBT2pU9uSLBv-aHvlgA0HfWnLoa_LfOj8fPRvya7WBHhcW_XoWpf4hMGLK0.ocDz8u8tmaRn2HBv Passcode: xZeC8*8Z
Link: https://github.zoom.us/rec/share/wbrLEYb8oXjfNnjbe2z_SehfnlH78XqEj8QXCEgcmkvToaZqoxrvsINKIvZCJlAG.QnaXDp03pF0qsLoT Passcode: 10u07D%7
Link: https://github.zoom.us/rec/share/Oi10Ad1zEm_W_5Tcbw6uzxI-obL6d9lPCWUiAdx5_ehsd6rzHfPk0F7uQyoixS-Z.AeeLvNMxI0DfZjwJ Passcode: .Q93s22+
Link: https://github.zoom.us/rec/share/MWBrEq45AurSEnmUcQtYKx1cRwpxzYSQRF58jyL7scBUx-6Cqiyv8CAP8joyirBJ.jCRHrcPId_IwpGZk Passcode: Wj=Zcd%8
Link: https://github.zoom.us/rec/share/vQHSbGaRdCY48EhOb32X4oe94d7jUBSMj5z2nQwwb_2NMNTnxzch6irlJ87t2A8.RJ8trG6-MZJ9Im5t Passcode: cY5tR9#@
[x] Other recommended tools to visualize git: Git Kraken Has beautiful visualization of branches and history
 Download
[x] Troubleshoot updating Git For Windows, with GitBash
For github.com use https://
For ford.github.com use ssh
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
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.
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}
During the set up of some of our repos we encountered an error regarding too long filenames:
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_
You might also want to enable Windows long path support, too.
Is that the best way to fix the error or are there better/more efficient solutions?
Yes, setting the git config is a good solution
git config --system core.longpaths true
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.
Feedback: Training Manual does not include code review process (Suggested Changes, Code Review Process)
TODO:
Feedback/Feature:
TODO:
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.
Do you have aleeady proven in use helper files for day-by-day git business?
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
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:
GitHub's 2 main centers are US-based (can't share exact locations). Some static content is served via CDN from global locations.
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
master
and development
Backport Flow
git cherry-pick --no-commit
Getting to need "push --force" by rebasing:
Post any questions you may have here during the training.