| 2021-01-07 |
| ← dqx left | 00:00 |
|
impermanence
| https://bpa.st/IOVA | 00:01 |
|
| nedbat | 00:01 |
|
nedbat
| impermanence: yes, the new directory is still there when you switch branches. | 00:01 |
|
| impermanence: git doesn't track empty directories, so it's independent of git | 00:01 |
|
impermanence
| okay I'll switch channels? | 00:01 |
|
nedbat
| impermanence: i don't understand. | 00:02 |
|
impermanence
| nor do I | 00:02 |
|
| I don't follow you | 00:02 |
|
nedbat
| impermanence: what is the problem? Why switch channels? | 00:02 |
|
impermanence
| I've no idea; I thought you were saying "it isn't git" | 00:02 |
|
nedbat
| impermanence: you were asking about how git works. | 00:02 |
|
| impermanence: the behavior you are seeing is expected. It's the way git works. | 00:02 |
|
| theree's no problem heree | 00:03 |
|
impermanence
| it happens with everything | 00:03 |
|
nedbat
| impermanence: what do you mean by everything? | 00:03 |
|
impermanence
| literally anything I do in one branch gets spammed to another | 00:03 |
|
| I'll show you | 00:03 |
|
| one sec | 00:03 |
|
nedbat
| impermanence: if you make other files, and switch branches, those files still exist also. | 00:04 |
|
impermanence
| yes | 00:04 |
|
nedbat
| it's because you haven't added those files to git yet, so git doesn't manage them. | 00:04 |
|
impermanence
| oh | 00:04 |
|
| hm | 00:04 |
|
| sorry | 00:04 |
|
| I feel adequately foolish | 00:05 |
|
nedbat
| impermanence: no need, these things have to be learned | 00:05 |
|
impermanence
| I don't know why that took me by surprise today | 00:05 |
|
| wait no... | 00:06 |
|
| something is definitely wrong though I think | 00:06 |
|
| yeah I wish it was that simple; | 00:06 |
|
| this happens for directories that are being tracked by git | 00:07 |
|
| so say I'm on branchA and it has tracked files in a dir called dirA; and on branchB there is no dirA; when I switch to branchB now all of sudden dirA is on branchB... | 00:08 |
|
| so yeah I'm not crazy that's not how git works | 00:08 |
|
| I'll provide you a screenshot | 00:08 |
|
| er: text | 00:08 |
|
nedbat
| impermanence: that would be good | 00:08 |
| → gjergj_kastrioti joined | 00:11 |
| → spacesuitdiver joined | 00:12 |
| ← tiin57 left | 00:14 |
|
impermanence
| nedbat: surreal. https://bpa.st/IDQQ | 00:14 |
| ← spacesuitdiver left | 00:15 |
|
nedbat
| impermanence: you made a new file in layer-0, but you didn't add it to git. | 00:16 |
| ← milkt_ left | 00:16 |
|
nedbat
| so it's a file outside of git, so git doesn't manage it. | 00:16 |
|
impermanence
| so? | 00:16 |
|
nedbat
| impermanence: so switch branches won't remove it. | 00:16 |
|
impermanence
| oh | 00:16 |
|
nedbat
| impermanence: so it's still there after you switch the bbranch | 00:16 |
|
impermanence
| I had no idea that was a git thing | 00:16 |
|
| that makes absolutely no sense | 00:17 |
| → tiin57 joined | 00:17 |
|
impermanence
| so if what you're saying is correct then if I add it layer-0 won't show up on that other branch... | 00:17 |
|
nedbat
| impermanence: right | 00:18 |
|
impermanence
| k | 00:18 |
|
| good | 00:18 |
| ← Sleepy63 left | 00:19 |
| → thiago joined | 00:19 |
| → Sleepy63 joined | 00:22 |
| → Newami joined | 00:23 |
|
impermanence
| man | 00:24 |
|
| what a relief | 00:24 |
|
| that was it nedbat | 00:24 |
|
| I never noticed before *shrug | 00:24 |
|
nedbat
| great :) | 00:25 |
| ← Newami left | 00:28 |
| → milkt joined | 00:30 |
| → adlternative joined | 00:32 |
| → oprypin joined | 00:35 |
| → spacesuitdiver joined | 00:39 |
| ← stats4647 left | 00:42 |
| ← tiin57 left | 00:44 |
| → tiin57 joined | 00:47 |
| ← bittyx left | 00:49 |
| → stats4647 joined | 00:50 |
| → filoppi joined | 00:51 |
| → ppppppp joined | 00:53 |
| ← ppppppp left | 00:54 |
| → sudoforge joined | 01:01 |
| ← Sleepy63 left | 01:04 |
| ← moldorcoder7 left | 01:06 |
| → moldorcoder7 joined | 01:06 |
| → Sleepy63 joined | 01:06 |
| ← Jitta left | 01:07 |
| → nomadicmathmo joined | 01:11 |
| ← moldorcoder7 left | 01:12 |
| → nomadicmathmo1 joined | 01:12 |
| ← tiin57 left | 01:14 |
| ← nomadicmathmo left | 01:16 |
| nomadicmathmo1 → nomadicmathmo | 01:16 |
| → moldorcoder7 joined | 01:16 |
| → tiin57 joined | 01:17 |
| → kalbasit joined | 01:20 |
| → bittyx joined | 01:20 |
| → fstd_ joined | 01:22 |
| fstd_ → fstd | 01:27 |
| ← CodeSlingerPaul left | 01:34 |
| ← AnAverageHuman left | 01:35 |
| ← PJBoy left | 01:35 |
| ← bolovanos left | 01:36 |
| → kevr joined | 01:37 |
| → jaziz1 joined | 01:38 |
| ← mat001 left | 01:43 |
| ← tiin57 left | 01:44 |
| → Wetmelon joined | 01:44 |
| ← al3x27 left | 01:47 |
| → tiin57 joined | 01:47 |
| ← wootehfoot left | 01:48 |
| ← cloud69 left | 01:48 |
| → Xenguy joined | 01:49 |
| → adl_ joined | 01:49 |
| ← adlternative left | 01:50 |
| → cim209 joined | 01:53 |
| → AnAverageHuman joined | 01:57 |
| → maestrojed joined | 01:57 |
| ← adl_ left | 01:59 |
| → adl_ joined | 01:59 |
| ← cbreak left | 02:00 |
| ← Kurozen left | 02:05 |
|
snappy
| is there a way to do like a git reset --soft except without moving HEAD. I kind of want to revert back to a git commit in history, but just have all those changes staged. | 02:07 |
| → INeedAHandle joined | 02:07 |
| → nsc joined | 02:11 |
| nsc → Guest58778 | 02:11 |
| ← Guest49216 left | 02:13 |
| ← tiin57 left | 02:14 |
| ← moldorcoder7 left | 02:15 |
| → tiin57 joined | 02:17 |
| → moldorcoder7 joined | 02:17 |
| ← maestrojed left | 02:17 |
| → maestrojed joined | 02:18 |
| ← F0rTex left | 02:18 |
|
BtbN
| snappy, git diff + patch -R? | 02:20 |
| → F0rTex joined | 02:20 |
| ← magic_ninja left | 02:20 |
|
BtbN
| Or hard reset to that commit, and then reset to your previous HEAD | 02:20 |
| ← zebrag left | 02:22 |
| → zebrag joined | 02:23 |
| ← filoppi left | 02:26 |
| def_jam → eb0t | 02:27 |
|
snappy
| BtbN: ah yeah that might do the trick, thanks | 02:27 |
| eb0t_ → eblip | 02:27 |
| ← justan0theruser left | 02:34 |
| ← heyitsrama left | 02:35 |
| ← mowcat left | 02:42 |
| ← tiin57 left | 02:44 |
| ← Jackneilll left | 02:44 |
| ← shush left | 02:45 |
| → dqx joined | 02:47 |
| → tiin57 joined | 02:47 |
| ← gjergj_kastrioti left | 02:48 |
|
Hello71
| git checkout HEAD^ . | 02:50 |
|
| or the modern slightly less confusing git restore -S -s HEAD^ | 02:50 |
| → Technodrome joined | 02:51 |
| ← gigasu_shida left | 02:54 |
| → gigasu_shida joined | 02:55 |
| → drbean joined | 02:56 |
| → Jackneilll joined | 02:56 |
| → perrier-jouet joined | 02:58 |
| ← amerigo left | 03:03 |
| ← nomadicmathmo left | 03:04 |
| ← milkt left | 03:04 |
| lagothrix → Guest44665 | 03:05 |
| → xirhtogal joined | 03:05 |
| ← Guest44665 left | 03:05 |
| xirhtogal → lagothrix | 03:05 |
| → milkt joined | 03:05 |
| ← AnAverageHuman left | 03:07 |
| → AnAverageHuman joined | 03:08 |
| → Muimi joined | 03:10 |
| → heyitsrama joined | 03:12 |
| ← heyitsrama left | 03:12 |
| ← tiin57 left | 03:14 |
| ← p-core left | 03:14 |
| → p-core joined | 03:14 |
| → tiin57 joined | 03:17 |
| ← maestrojed left | 03:21 |
| → Muimi_ joined | 03:21 |
| ← retrospectacus left | 03:22 |
| ← zebrag left | 03:22 |
| ← Muimi left | 03:23 |
| → zebrag joined | 03:23 |
| Muimi_ → Muimi | 03:23 |
| → retrospectacus joined | 03:23 |
| → maestrojed joined | 03:25 |
| → n000g joined | 03:30 |
| → mgedmin joined | 03:35 |
| ← Sleepy63 left | 03:38 |
| ← benfelin left | 03:42 |
| → Sleepy63 joined | 03:42 |
| ← n000g left | 03:42 |
| → FH_thecat joined | 03:43 |
| ← tiin57 left | 03:44 |
| → tiin57 joined | 03:47 |
| → R2robot joined | 03:47 |
|
kevr
| when i use `git add -p`, it seems to select stages for me. is there a way i can split up one of those stages? | 03:50 |
| → n000g joined | 03:51 |
| → pyeverything joined | 03:52 |
|
pyeverything
| you know how i can do git diff between a file that has not yet been "git add"ed and a file on master branch already pushed? same file name | 03:53 |
|
kevr
| say what? | 03:54 |
| → geosmile joined | 03:54 |
|
kevr
| you can run a diff between commits, and using a branch name will use HEAD of that branch | 03:54 |
|
| like `git diff HEAD..master` | 03:54 |
|
| if it's not in a local copy though, you need the commits from master fetches, then you can diff between your current state and origin/master | 03:55 |
|
| (or upstream/master, whatever.) | 03:55 |
| ← n000g left | 04:03 |
| ← Iarfen left | 04:03 |
| ← rosco_y left | 04:04 |
| ← spacesuitdiver left | 04:06 |
| → codebam__ joined | 04:06 |
| → n000g joined | 04:09 |
| ← codebam_ left | 04:09 |
| ← pyeverything left | 04:09 |
| ← cliluw left | 04:09 |
| ← n000g left | 04:09 |
| ← Guest58778 left | 04:12 |
| ← tiin57 left | 04:14 |
| → cliluw joined | 04:14 |
| → magic_ninja joined | 04:15 |
| → Anthaas joined | 04:15 |
| → mat001 joined | 04:15 |
| → nsc joined | 04:16 |
| nsc → Guest55008 | 04:16 |
| → tiin57 joined | 04:17 |
| ← gast0n left | 04:18 |
| ← drbean left | 04:18 |
| ← cliluw left | 04:18 |
| ← iNs left | 04:21 |
| → iNs joined | 04:22 |
| ← zebrag left | 04:22 |
| → zebrag joined | 04:23 |
| ← maestrojed left | 04:23 |
| → pyeverything joined | 04:25 |
| ← pyeverything left | 04:25 |
| ← FH_thecat left | 04:25 |
| → FH_thecat joined | 04:29 |
| → Guest20 joined | 04:30 |
| → mindCrime joined | 04:34 |
| ← thiago left | 04:34 |
| ← acercle left | 04:36 |
| ← Wetmelon left | 04:37 |
| ← stats4647 left | 04:38 |
| ← tiin57 left | 04:44 |
| → Goplat joined | 04:46 |
| ← Xenguy left | 04:47 |
| → tiin57 joined | 04:47 |
| ← zsoc left | 04:52 |
| → Hounddog joined | 05:07 |
| ← dking left | 05:09 |
| ← AnAverageHuman left | 05:09 |
| ← Guest20 left | 05:13 |
| ← tiin57 left | 05:14 |
| → tiin57 joined | 05:17 |
| → cliluw joined | 05:17 |
| ← zebrag left | 05:22 |
| → zebrag joined | 05:23 |
| ← cliluw left | 05:23 |
| ← FH_thecat left | 05:23 |
| → Guest20 joined | 05:26 |
| → cliluw joined | 05:26 |
| ← cliluw left | 05:31 |
| → al3x27 joined | 05:34 |
| ← Betal left | 05:43 |
| ← tiin57 left | 05:44 |
| ← geosmile left | 05:45 |
| → dermoth_ joined | 05:46 |
| dermoth_ → dermoth | 05:47 |
| → tiin57 joined | 05:47 |
| ← arcatech left | 05:48 |
| ← TheConjurer left | 05:53 |
| ← Maxattax left | 05:54 |
| → shush joined | 05:56 |
| ← alyawn left | 06:00 |
| ← shush left | 06:01 |
| ← Hounddog left | 06:02 |
| → fuzzmz_ joined | 06:02 |
| fuzzmz_ → fuzzmz | 06:03 |
| → sord937 joined | 06:05 |
| ← tiin57 left | 06:14 |
| → jrm2 joined | 06:15 |
| jrm2 → jrm | 06:16 |
| → tiin57 joined | 06:17 |
| → crose joined | 06:18 |
| → ferdna joined | 06:21 |
| ← zebrag left | 06:22 |
| → zebrag joined | 06:23 |
| ← yrzr left | 06:25 |
| ← mindCrime left | 06:27 |
| → cliluw joined | 06:27 |
| → spyroboy joined | 06:29 |
| ← spyroboy left | 06:29 |
| → spyroboy joined | 06:29 |
| ← cliluw left | 06:32 |
| ← kenwoodfox left | 06:34 |
| → mindCrime joined | 06:34 |
| → qassim joined | 06:43 |
| ← tiin57 left | 06:44 |
| → tiin57 joined | 06:47 |
| ← qassim left | 06:52 |
| → TheConjurer joined | 07:01 |
| → Xiti joined | 07:05 |
| ← ferdna left | 07:05 |
| → toolbox joined | 07:06 |
| → qassim joined | 07:07 |
| ← madewokherd left | 07:07 |
| → cliluw joined | 07:08 |
| ← kalbasit left | 07:08 |
| ← opal left | 07:11 |
| → mobidrop joined | 07:13 |
| ← cliluw left | 07:13 |
| ← tiin57 left | 07:14 |
| → rfuentess joined | 07:15 |
| → opal joined | 07:15 |
| → thrill_seeker joined | 07:15 |
| → tiin57 joined | 07:17 |
| → Wetmelon joined | 07:23 |
| → nomadicmathmo joined | 07:23 |
| ← andy25225 left | 07:24 |
| → ravndal joined | 07:26 |
| ← nomadicmathmo left | 07:27 |
| ← mindCrime left | 07:27 |
| ← thrill_seeker left | 07:28 |
| → thrill_seeker joined | 07:28 |
| ← sudoforge left | 07:36 |
| → andy25225 joined | 07:38 |
| → TomyWork joined | 07:38 |
| → riksteri joined | 07:38 |
| → Fokst joined | 07:41 |
| → Haohmaru joined | 07:42 |
| → skyroveRR joined | 07:43 |
| ← tiin57 left | 07:44 |
| → erred joined | 07:45 |
| → codebam_ joined | 07:46 |
| → tiin57 joined | 07:47 |
| ← erred left | 07:48 |
| ← codebam__ left | 07:48 |
| ← qassim left | 07:50 |
|
skyroveRR
| Hey guys, I've got a linux distribution repo from which I'd like to revert/restore only a couple of files which were removed from a particular commit, which is this: http://git.pktsurf.in/smlinux/commit/?id=4257f6f8d51f95a5b81d939c1af95ebde7e888bd . I'd like to restore files in that commit that have the path "source/lxde" ... can someone kindly provide pointers on how this can be done? | 07:52 |
| → otisolsen70 joined | 07:53 |
|
ikke
| git checkout 4257f6f8d51f95a5b81d939c1af95ebde7e888bd -- source/lxde | 07:55 |
|
| this would chekout any file in source/lxde from that commit | 07:55 |
|
skyroveRR
| ikke: I ran your command and I get this: error: pathspec 'source/lxde' did not match any file(s) known to git | 07:56 |
|
osse
| you have to use that commit's parent | 07:57 |
|
| Boo, ikke, boo! | 07:57 |
|
ikke
| :( | 07:57 |
|
osse
| Also, git diff --diff-filter=D --name-only 4257f6f8d51f95a5b8~ 4257f6f8d51f95a5b8 is the actual list of files you want | 07:57 |
|
skyroveRR
| Uh.. I had files in staging... they've disappeared from there. | 08:00 |
| → cbreak joined | 08:01 |
|
skyroveRR
| ... maybe not. Sorry. | 08:01 |
|
| Yup. Got the files back. | 08:01 |
|
| Thanks osse | 08:02 |
| ← unluckyshrubbery left | 08:02 |
| ← andreas303 left | 08:05 |
| → qassim joined | 08:05 |
| → andreas303 joined | 08:06 |
| → theoceaniscool joined | 08:07 |
| ← bn_work left | 08:10 |
|
skyroveRR
| osse: a question: why use the parent commit hash? That commit doesn't have anything relating to LXDE... | 08:11 |
|
osse
| skyroveRR: commits are not diffs or patches. they are snapshots | 08:11 |
|
| skyroveRR: and the parent commit is the last commit those files existed in | 08:11 |
|
skyroveRR
| Ohh. Crystal clear. | 08:11 |
|
osse
| skyroveRR: so in principle you could use any commit you like to grab them from, but you might get different versions of them then | 08:13 |
|
| well... any commit they exist in, of course. Like ikke FAILED TO DO | 08:13 |
|
| <3 | 08:13 |
| ← dqx left | 08:13 |
| ← tiin57 left | 08:14 |
| → vdamewood joined | 08:14 |
|
ikke
| 😢 | 08:14 |
| → rcoote joined | 08:14 |
| ← theoceaniscool left | 08:15 |
| → tiin57 joined | 08:17 |
| → theoceaniscool joined | 08:17 |
| ← zebrag left | 08:22 |
| → zebrag joined | 08:23 |
| ← Goplat left | 08:23 |
|
jaziz1
| when 'cloning' a remote tracking-branch, is the better practice to create a branch and merge the remote into it, or something like `git checkout -b localbranch origin/remotebranch` | 08:27 |
|
| what is the term for bringing a remote-tracking branch into use, actually? | 08:27 |
|
osse
| you clone a repo, not a branch. Usually after cloning you already have a bunch of remote tracking branches. By "use" I assume do development, make commits and such. For that you should create a local branch | 08:28 |
|
ikke
| (so your last suggestion) | 08:29 |
|
jaziz1
| I see, sorry for poor jargon | 08:29 |
| → Borkr joined | 08:30 |
| ← gigasu_shida left | 08:30 |
|
vdamewood
| jaziz1: The term for making a branch from another branch is 'branching'. This applies to making a local branch to track a remote as well. | 08:30 |
|
| or 'branching off' | 08:31 |
|
jaziz1
| oh I see, thanks | 08:31 |
|
| I think I'll take a break from this book after I finish this chapter on branching, prob have enough now to get to work | 08:32 |
|
vdamewood
| jaziz1: And the best practice is to directly branch off rather than do any merging, first. | 08:32 |
|
jaziz1
| I'll need to figure out a workflow, not used to structured coding | 08:32 |
|
| vdamewood, oh great thanks, that felt like the right thing to do | 08:32 |
|
| the book mentioned merging as well, though, so was curious | 08:32 |
| ← mat001 left | 08:34 |
| → codebam__ joined | 08:34 |
| ← codebam_ left | 08:36 |
| → shush joined | 08:38 |
| → codebam_ joined | 08:39 |
| → sgn1 joined | 08:41 |
| ← codebam__ left | 08:42 |
| → nabil_ joined | 08:43 |
| ← shush left | 08:43 |
| ← tiin57 left | 08:44 |
| ← sgn left | 08:44 |
|
skyroveRR
| osse: thanks a lot. Laters. | 08:44 |
| ← skyroveRR left | 08:44 |
| ← nabil__ left | 08:46 |
| ← g00s left | 08:47 |
| → tiin57 joined | 08:47 |
| → g00s joined | 08:48 |
| ← iNs left | 08:54 |
| → iNs joined | 08:54 |
| → mozgalom joined | 08:58 |
| → __Aqua_Vitae__ joined | 09:00 |
| → chele joined | 09:02 |
| → Fissure1 joined | 09:05 |
| ← tiin57 left | 09:14 |
| → tiin57 joined | 09:17 |
| ← hnOsmium0001 left | 09:18 |
| ← zebrag left | 09:22 |
| → zebrag joined | 09:23 |
| ← cd left | 09:23 |
| → shivam_ joined | 09:24 |
| ← impermanence left | 09:24 |
| → PJBoy joined | 09:24 |
| → another joined | 09:25 |
| → mindCrime joined | 09:28 |
| → clime joined | 09:29 |
| → calcul0n_ joined | 09:40 |
| → unluckyshrubbery joined | 09:40 |
| ← tiin57 left | 09:44 |
| → tiin57 joined | 09:47 |
| ← Wetmelon left | 09:47 |
| → lofo_ joined | 09:49 |
| ← lofo left | 09:53 |
| → dudek joined | 09:59 |
| → nabil__ joined | 10:01 |
| ← nabil_ left | 10:04 |
| → benfelin joined | 10:12 |
| ← tiin57 left | 10:14 |
| → tiin57 joined | 10:17 |
| ← zebrag left | 10:22 |
| → zebrag joined | 10:23 |
| → justanotheruser joined | 10:29 |
| → biryukov joined | 10:29 |
|
jaziz1
| Would it be okay to specify certain sections of a file for certain code additions? | 10:30 |
|
| to prevent merge conflicts? | 10:30 |
|
| maybe in code comments or something | 10:30 |
|
osse
| Git has no way of enforcing that | 10:31 |
| → shabius joined | 10:32 |
|
osse
| But you can have any agreements you like human to human | 10:32 |
| ← shabius left | 10:32 |
| → Sp4rKy joined | 10:32 |
| → shabius_ joined | 10:32 |
| ← shabius_ left | 10:32 |
|
jaziz1
| Yeah, was just wondering if people did that I guess | 10:32 |
|
| given I haven't really been part of a team | 10:32 |
|
osse
| There's no "I" in "team", but there is one in "merge conflict" | 10:33 |
| → shabius joined | 10:33 |
|
jaziz1
| lol | 10:34 |
| ← austin987 left | 10:37 |
|
vdamewood
| There's a 'me' in team, scrambled in there. | 10:38 |
|
| Come to think of it, team is an anagram of "at me". | 10:39 |
| ← Sp4rKy left | 10:39 |
| ← tiin57 left | 10:44 |
| ← __Aqua_Vitae__ left | 10:44 |
| → tiin57 joined | 10:47 |
| → austin987 joined | 10:49 |
| → humanface22 joined | 10:51 |
|
humanface22
| hi all | 10:51 |
|
gitinfo
| humanface22: hi! I'd like to automatically welcome you to #git, a place full of helpful gits. Got a question? Just ask it — chances are someone will answer fairly soon. The topic has links with more information about git and this channel. NB. it can't hurt to do a backup (type !backup for help) before trying things out, especially if they involve dangerous keywords such as --hard, clean, --force/-f, rm and so on. | 10:51 |
| ← mindCrime left | 10:52 |
| ← thrill_seeker left | 10:53 |
| → blahdodo joined | 10:53 |
| → thrill_seeker joined | 10:53 |
|
humanface22
| is the git able to do the following?: checkout a previous commit on branch A (lets call this 1. commit), create a branch B on that, miss branch A's 2. and 3. commit, and add only the 4. 5. 6. 7. commits into the branch B | 10:54 |
|
| should I cherry pick 4. 5. 6. 7. commits in order? | 10:55 |
| → __Aqua_Vitae__ joined | 10:57 |
| ← maxwilliamson left | 11:00 |
| → maxwilliamson joined | 11:01 |
| → cheater joined | 11:01 |
|
cheater
| hi! what's the best way to: create a new branch; which tracks a remote on origin of the same name; and switch to that branch? | 11:02 |
|
| git checkout -b newbranch doesn't track remote | 11:02 |
|
ikke
| git checkout -t origin/newbranch, or git checkout newbranch | 11:04 |
|
| the latter is automatically creating the branch when it does not exist yet, and there is only one remote branch with that name | 11:04 |
|
osse
| humanface22: that is not a problem | 11:05 |
| ← Trieste left | 11:05 |
|
humanface22
| osse what do you mean? | 11:05 |
|
osse
| humanface22: the thing you described is straight forward to do | 11:06 |
|
humanface22
| osse ok, so what is the answer? | 11:06 |
|
| osse should I cherry pick 4. 5. 6. 7. commits in order? | 11:06 |
|
| so should I do those steps in order? checking out that commit, creating branch, cherry picking those commits? | 11:07 |
|
osse
| humanface22: create a new branch named B at the point where you want B to start from. check it out, then cherry-pick in date order | 11:07 |
|
cheater
| ikke: both don't work. the first one says "fatal: 'origin/newbranch' is not a commit and a branch 'newbranch' cannot be created from it" and the second one says "error: pathspec 'newbranch' did not match any file(s) known to git.". | 11:08 |
| → Trieste joined | 11:08 |
|
humanface22
| osse ok is it differ from what I said already? | 11:08 |
|
ikke
| cheater: If it's a completely new branch, then there is no remote tracking branch yet to track | 11:08 |
|
osse
| humanface22: maybe not. depends a bit on what you meant by the numbers | 11:08 |
|
cheater
| well yes, i said "new branch", that's what i meant | 11:09 |
|
ikke
| cheater: then you first create it locally, and when you push, you specify --set-upstream | 11:09 |
|
cheater
| what can i do so that i don't need to --set-upstream explicitly? | 11:09 |
|
humanface22
| osse the date order :) firstly you create the 1. commit, then the 2. commit, and so on | 11:09 |
|
cheater
| i just want it to know it should be set to remote/newbranch | 11:09 |
|
| is there no command that does both? | 11:09 |
|
ikke
| cheater: not when remote/newbranch does not exist yet | 11:10 |
|
| which gets created after you push | 11:10 |
|
cheater
| so what would i do, just git checkout -b to create a local branch, and then --set-upstream later? | 11:10 |
|
ikke
| yes | 11:10 |
|
cheater
| ok. thanks | 11:10 |
|
ikke
| git push -u <remote> <branch> | 11:10 |
|
osse
| humanface22: then what you describe is spot on | 11:10 |
|
humanface22
| osse ok, thanks | 11:11 |
| → aw1 joined | 11:11 |
| → PacKetSlayer joined | 11:12 |
| ← tiin57 left | 11:14 |
|
cheater
| thank you ikke | 11:17 |
| → tiin57 joined | 11:17 |
| ← humanface22 left | 11:19 |
| ← zebrag left | 11:22 |
| → nabil_ joined | 11:22 |
| → zebrag joined | 11:23 |
| ← nabil__ left | 11:25 |
| → BH23_ joined | 11:25 |
| → thiago joined | 11:28 |
| → mellernoia joined | 11:30 |
| → nabil__ joined | 11:34 |
| ← sgn1 left | 11:36 |
| ← nabil_ left | 11:37 |
| → aliss joined | 11:37 |
| ← Jookia left | 11:37 |
| ← caveman left | 11:38 |
| → sgn joined | 11:41 |
| → Guest20_ joined | 11:41 |
| ← Guest20 left | 11:42 |
| → lacrymology joined | 11:42 |
| → DevAntoine joined | 11:43 |
| ← tiin57 left | 11:44 |
| ← milkt left | 11:44 |
| ← adl_ left | 11:45 |
| → Masklin joined | 11:45 |
| → adl_ joined | 11:45 |
| → Atlenohen joined | 11:46 |
| ← adl_ left | 11:47 |
| → adl_ joined | 11:47 |
| → tiin57 joined | 11:47 |
| → calcul0n__ joined | 11:48 |
| ← DevAntoine left | 11:48 |
| ← calcul0n_ left | 11:50 |
| ← j7k6 left | 11:51 |
| → milkt joined | 11:52 |
| ← al3x27 left | 12:00 |
| → rosco_y joined | 12:01 |
| ← adl_ left | 12:05 |
| → adl_ joined | 12:05 |
| → NitrousPG joined | 12:07 |
| → dwmw2_gone joined | 12:09 |
| ← adl_ left | 12:10 |
| → adlternative joined | 12:10 |
| ← tiin57 left | 12:14 |
| → gjergj_kastrioti joined | 12:17 |
| ← __Aqua_Vitae__ left | 12:17 |
| → tiin57 joined | 12:18 |
| ← andreas303 left | 12:18 |
| → tgunr joined | 12:21 |
| ← shivam_ left | 12:22 |
| ← zebrag left | 12:22 |
| → zebrag joined | 12:23 |
| → cliluw joined | 12:24 |
| → davve joined | 12:25 |
|
davve
| hey, is there an interactive or convenient way of creaning up ones branches (local and remote?) | 12:26 |
|
| i tend to make a lot of them ^^ | 12:26 |
|
osse
| local: not directly. git branch --merged master produces a list of branches that's at least safe to remove | 12:27 |
|
davve
| like interactive rebase where they all default to keep or something | 12:27 |
|
osse
| remote: try git fetch --prune | 12:27 |
|
davve
| osse: do you mean me? | 12:27 |
|
| ah right | 12:27 |
|
| ofc you do lol. cool i'll try that, thought local and remote were two people in here :) | 12:28 |
|
| the --merged master arguments to branch is great | 12:29 |
| ← cliluw left | 12:29 |
|
davve
| prune cleaned up a few too. neat | 12:29 |
| → __Aqua_Vitae__ joined | 12:31 |
| ← luke-jr left | 12:31 |
|
davve
| but i still have a bunch, will have to write up a script i think. I'll try googling too | 12:31 |
|
osse
| davve: local ones? | 12:32 |
|
| you can remove those too in one swoop if you really wish | 12:32 |
|
davve
| yeah | 12:32 |
|
| no i'd rather have a prompt or somthing :) | 12:32 |
|
| some are keepers | 12:32 |
| → luke-jr joined | 12:32 |
|
davve
| but for science, how would you do that? | 12:33 |
| → andreas303 joined | 12:35 |
|
osse
| something like: | 12:35 |
| → wootehfoot joined | 12:35 |
|
osse
| git for-each-ref --merged master --format='delete %(refname)' -- refs/heads | sed '/\/master$/d' | git update-ref --stdin | 12:35 |
|
| for-each-ref is the script-friendly version of git branch/tag | 12:36 |
| → Peetz0r joined | 12:39 |
| → shivam_ joined | 12:40 |
| → shush joined | 12:40 |
| → Tazmanya joined | 12:41 |
| ← Tazmanya left | 12:43 |
| ← tiin57 left | 12:44 |
| ← shush left | 12:45 |
| → tiin57 joined | 12:47 |
| ← Guest20_ left | 12:47 |
| → bolovanos joined | 12:48 |
|
jjakob
| I run git rebase commithash^ , select the commithash to edit, but git rebase shows the commit I selected to edit as already done? Last command done (1 command done): edit abcdefg mycommit | 12:50 |
| → worc3131 joined | 12:50 |
|
jjakob
| running git reset resets no files... | 12:50 |
|
osse
| jjakob: edit means git rebase stops after that commit, and you can change it with commit --amend | 12:51 |
|
| then run rebase --continue | 12:51 |
|
jjakob
| ah right, but I want to split it into 2 | 12:51 |
|
| reset HEAD~ ? | 12:52 |
|
osse
| yes | 12:52 |
|
| but since it is only the latest commit you want to change, you can do it all without the rabase stuff | 12:52 |
|
jjakob
| it's not the latest, it's quite a few back | 12:52 |
|
osse
| oh | 12:53 |
|
| i misunderstood the initial question | 12:53 |
|
| in that case, carry on | 12:53 |
|
jjakob
| I selected it with commithash~ | 12:53 |
| → DevAntoine joined | 12:55 |
| ← cheater left | 12:57 |
| ← vdamewood left | 12:59 |
| ← sgn left | 13:00 |
| → Guest20 joined | 13:01 |
| ← worc3131 left | 13:01 |
| → worc3131 joined | 13:02 |
| → sgn joined | 13:06 |
|
relipse
| I have a fork of the primary repo, how do I make my fork's master the exact same as the primary repo? i tried git rebase remote/master but it had some 3 way merge stuff | 13:07 |
| → Jitta joined | 13:09 |
| ← bolovanos left | 13:11 |
|
relipse
| i tried git pull remote master but that din't work eather said fix conflicts | 13:12 |
|
j416
| relipse: reset | 13:13 |
| ← tiin57 left | 13:14 |
|
relipse
| git reset --hard upstream/master | 13:14 |
|
| that did it. thank you j416 | 13:14 |
| → jl4 joined | 13:17 |
|
jaziz1
| what are some good git workflows I should look into? | 13:17 |
| → tiin57 joined | 13:18 |
| → j7k6 joined | 13:18 |
| ← sweatsuit left | 13:20 |
| ← zebrag left | 13:22 |
| → zebrag joined | 13:23 |
|
jaziz1
| never done any real work in git, just kind of haphazardly wrote things, copy/pasted for backup, etc | 13:23 |
| → Jookia joined | 13:23 |
| → caveman joined | 13:24 |
| → rsx joined | 13:24 |
| ← luke-jr left | 13:25 |
| → sweatsuit joined | 13:25 |
| → luke-jr joined | 13:25 |
|
osse
| if you work alone I would not focus much on workflows | 13:26 |
|
| that's for your boss to decide, unless you *are* a boss | 13:26 |
| ← justanotheruser left | 13:26 |
|
osse
| make commits that make sense, and use different branches for different things if you switch between areas you work on | 13:27 |
|
jaziz1
| I see | 13:28 |
|
| Maybe one 'main' branch for stable things and then branch off for individual features? | 13:28 |
|
osse
| yes | 13:31 |
| → dionysus69 joined | 13:31 |
| → mat001 joined | 13:32 |
| ← spyroboy left | 13:32 |
| ← Guest20 left | 13:32 |
| → zsoc joined | 13:35 |
| ← zsoc left | 13:35 |
| → zsoc joined | 13:35 |
| ← biryukov left | 13:35 |
| → justanotheruser joined | 13:40 |
| → dd7 joined | 13:41 |
| ← tilpner left | 13:42 |
|
jaziz1
| reading about this 'rebase' and 'fast forward' stuff | 13:42 |
| → tilpner joined | 13:42 |
|
jaziz1
| is it not bad to lose history that you don't have to lose? | 13:43 |
|
| thought one of the points of git was to easily identify what has happened in the past? | 13:43 |
| ← tiin57 left | 13:43 |
|
dd7
| I notice that if the `core.pager` process reads git config by invoking `git config --list`, that it picks up modifications to the config made on the command line of the parent git process by e.g. `git -c foo.bar=baz`. How does this happen? I would have thought that `git -c` causes the config object to be mutated in the memory of the parent process | 13:44 |
|
| whereas `git config --list` is simply reading from disk again. | 13:44 |
| → tiin57 joined | 13:47 |
| ← dionysus69 left | 13:48 |
| → Voltum joined | 13:48 |
| ← Voltum left | 13:48 |
|
osse
| jaziz1: some history is not worth keeping | 13:50 |
|
| jaziz1: let's say you make a commit. then you find you forgot to add a file to it. so you do that, and modify the commit you just created instead of making a second commit | 13:50 |
|
| technically, the "bad" commit is still lying around | 13:50 |
|
ikke
| Some use git append-only, sadly | 13:51 |
| ← __Aqua_Vitae__ left | 13:51 |
|
osse
| jaziz1: but it will be lost, and no one sheds a tear for it | 13:51 |
|
jaziz1
| osse, mm right | 13:52 |
|
| that seems less consequential than something like rebase though | 13:52 |
|
osse
| depends on how you use it | 13:52 |
|
| the usual form of a rebase is to just put your commits on top | 13:53 |
| → n0mn0m joined | 13:53 |
|
dd7
| jaziz1: a big factor is whether you're talking about work that only exists on your personal machine, or work that you've pushed to a remote and others may be sharing. | 13:53 |
| ← xelxebar left | 13:53 |
|
jaziz1
| dd7, that makes sense, local history might not be relevant to the repo as a whole | 13:53 |
|
dd7
| If it's your local personal work, it's common to make a bunch of messy commits and then tidy them up afterwards | 13:54 |
|
| "tidy up" the history I mean | 13:54 |
|
jaziz1
| mm | 13:54 |
| ← rcoote left | 13:54 |
|
dd7
| Personally my rules are (a) I do that a lot and (b) but I don't if it involves any kind of merge conflict resolution | 13:54 |
|
jaziz1
| I'm just trying to get a good sense of best practices since I won't be able to do it on the job | 13:54 |
|
| since no job lmao | 13:54 |
|
osse
| as for fast-forwarding, that has nothing to do with losing history | 13:55 |
|
jaziz1
| dd7, I see | 13:55 |
|
| osse, you could be losing *some* history, though, right? | 13:56 |
|
| as shown here? https://i.snipboard.io/9goF0P.jpg | 13:56 |
|
osse
| this is showing two end results | 13:57 |
|
| the new yellow dot on the left hand side doesn't exist before you start | 13:57 |
|
ikke
| In that case you're note losing history, at most, you cannot distinguish in the 2nd example that those commits belong together | 13:57 |
|
jaziz1
| osse, hmm | 13:58 |
|
osse
| you could argue there is some history that will never be created | 13:58 |
|
| and in many cases you don't want that history, for example when you're not merging in a feature, but just merging in origin/master (ie. gettnig your local master up to date) | 13:58 |
|
jaziz1
| right | 13:59 |
|
| ikke, well, knowing where you' branched off for a feature is still history right? | 14:00 |
|
osse
| what if the feature branch has been rebased multiple times before it is merged in? :P | 14:00 |
|
jaziz1
| no idea haha | 14:01 |
|
| visualizing rebasing is still kinda tough for me honestly haha | 14:01 |
|
osse
| my point is that the branched-off point might not be the actual point at which the feature development started | 14:01 |
|
| https://github.com/Osse/git-stuff/blob/master/rebase.txt | 14:02 |
|
ikke
| (in the 2nd example, the old commits are still there where they were, just not referenced anymore by the current branch | 14:02 |
|
| 0 | 14:02 |
| n0mn0m → n0mn0m[away] | 14:03 |
| → __Aqua_Vitae__ joined | 14:03 |
| → haslo joined | 14:03 |
| ← n0mn0m[away] left | 14:04 |
|
jaziz1
| osse, hmm I guess I've misunderstood rebase, too haha | 14:05 |
|
| it was my understanding that it'd just overlap commits starting from where it branched off | 14:06 |
|
osse
| jaziz1: rebase = re-base = changing the "base" of a branch (ie. where it appears to have branched off) | 14:06 |
| ← dd7 left | 14:06 |
|
jaziz1
| I see | 14:07 |
|
osse
| jaziz1: using my fancy ascii art for reference: Before the "base" of the feature branch was D, but after the rebase it is H | 14:07 |
|
| the base has changed => the branch has been re-based | 14:08 |
|
jaziz1
| mhmm | 14:08 |
| ← thiago left | 14:13 |
| → mowcat joined | 14:13 |
| ← tiin57 left | 14:14 |
|
osse
| that means rewriting some commits and stuff. as ikke said the old commits are still around, technically | 14:15 |
|
| but they have been LOST :O :O | 14:15 |
| → sudoforge joined | 14:15 |
|
osse
| Kate, we have to go back! | 14:15 |
|
jaziz1
| oooh I see | 14:15 |
|
| so you take the base of the branch | 14:15 |
|
| and the just kind of append the commits in the same progression to the end of the other one? | 14:15 |
|
| and if the work is totally independent you come out with no conflicts? | 14:16 |
|
selckin
| you have a tree, saw off a branch, and glue it on somewhere else | 14:17 |
|
jaziz1
| lmao | 14:17 |
|
ikke
| (while you are standing on it) | 14:17 |
| → tiin57 joined | 14:18 |
|
jaziz1
| how are you going to commit if you're splattered all over the ground? | 14:18 |
|
osse
| jaziz1: yep, that's essentially what happens | 14:19 |
|
jaziz1
| coool | 14:19 |
|
osse
| d'accord | 14:21 |
| ← zebrag left | 14:22 |
| → zebrag joined | 14:23 |
| ← gjergj_kastrioti left | 14:23 |
| → xelxebar joined | 14:26 |
| ← mowcat left | 14:27 |
| → herren joined | 14:28 |
| ← ghost43 left | 14:28 |
| → ghost43 joined | 14:29 |
| ← retrospectacus left | 14:31 |
| → retrospectacus joined | 14:31 |
| → bolovanos joined | 14:37 |
| ← __Aqua_Vitae__ left | 14:39 |
| ← Jck_true left | 14:41 |
| → Jck_true joined | 14:42 |
| ← perrier-jouet left | 14:43 |
| ← milkt left | 14:43 |
| ← tiin57 left | 14:44 |
| → tiin57 joined | 14:47 |
| → milkt joined | 14:49 |
| → impermanence joined | 14:49 |
| → __Aqua_Vitae__ joined | 14:52 |
| → k3yp joined | 14:55 |
| → perrier-jouet joined | 14:56 |
| ← perrier-jouet left | 14:58 |
| → AnAverageHuman joined | 14:58 |
| → k3yp- joined | 14:59 |
| ← k3yp left | 15:00 |
| k3yp- → k3yp | 15:01 |
| ← adlternative left | 15:02 |
| → Maxattax joined | 15:02 |
| → adlternative joined | 15:02 |
| → CodeSlingerPaul joined | 15:07 |
| ← Borkr left | 15:08 |
| ← jl4 left | 15:08 |
| ← impermanence left | 15:09 |
| → maxwilli- joined | 15:09 |
| ← maxwilliamson left | 15:10 |
| → perrier-jouet joined | 15:11 |
| → acercle joined | 15:11 |
| ← tiin57 left | 15:14 |
| → Newami joined | 15:15 |
| ← Newami left | 15:16 |
| → spacesuitdiver joined | 15:16 |
| → gavlee joined | 15:17 |
| → tiin57 joined | 15:17 |
| → wrobinso1 joined | 15:18 |
| ← aw1 left | 15:20 |
| → aw1 joined | 15:21 |
| ← wrobinson left | 15:22 |
| ← zebrag left | 15:22 |
| → zebrag joined | 15:23 |
| ← adlternative left | 15:26 |
| → redcaptrickster joined | 15:34 |
| → lofo joined | 15:36 |
| ← lofo_ left | 15:39 |
| → Xenguy joined | 15:40 |
| ← worc3131 left | 15:41 |
| ← justanotheruser left | 15:42 |
| ← tiin57 left | 15:44 |
| ← austin987 left | 15:44 |
| → trinityblade joined | 15:44 |
| ← acercle left | 15:47 |
| → tiin57 joined | 15:47 |
| → acercle joined | 15:48 |
| ← Xiti left | 15:57 |
| → austin987 joined | 15:57 |
| → hnOsmium0001 joined | 15:59 |
| ← DevAntoine left | 15:59 |
| → DevAntoine joined | 15:59 |
| → al3x27 joined | 16:02 |
| ← sudoforge left | 16:02 |
| → sudoforge joined | 16:04 |
| → Borkr joined | 16:04 |
| ← DevAntoine left | 16:04 |
|
southerntofu
| hey folks i don't know if this is okay according to your etiquette, but i'd like to bring attention to a bug report i submitted two days ago on the ML (with no answer so far): https://public-inbox.org/git/X%2FSq38YKmLjY4KmD@thunix.net/T/#u | 16:04 |
|
| thanks and have a great day :) | 16:05 |
| ← fling left | 16:05 |
| ← thrill_seeker left | 16:06 |
| → nkz joined | 16:06 |
| → thrill_seeker joined | 16:07 |
|
nkz
| Hey, noob here. When I master into feature branch, git creates a merge-commit. When I do that other way around git doesn't create a merge-commit, just adds on commits. Why is that? | 16:07 |
|
| *When I merge master into feature branch* | 16:08 |
| ← sudoforge left | 16:10 |
| → fling joined | 16:10 |
| ← shivam_ left | 16:12 |
|
osse
| nkz: git doesn't make a merge commit unless it has to | 16:12 |
|
| so if one branch can be "fast-forwarded", that's what happens | 16:12 |
|
| when you do it the other way I would suspect it just says "already up-to-date" and does nothing at all | 16:13 |
| → mindCrime joined | 16:13 |
| ← haslo left | 16:13 |
| ← tiin57 left | 16:14 |
|
nkz
| osse: makes sense, thanks! | 16:14 |
| → Xiti joined | 16:16 |
| ← thrill_seeker left | 16:16 |
| → tiin57 joined | 16:17 |
| → thrill_seeker joined | 16:17 |
| ← thrill_seeker left | 16:17 |
| → thrill_seeker joined | 16:17 |
| ← thrill_seeker left | 16:18 |
| → mowcat joined | 16:18 |
| ← TomyWork left | 16:18 |
| → DevAntoine joined | 16:19 |
| → thrill_seeker joined | 16:19 |
| ← thrill_seeker left | 16:19 |
| → thrill_seeker joined | 16:20 |
| ← thrill_seeker left | 16:20 |
| → Iarfen joined | 16:20 |
| → thrill_seeker joined | 16:20 |
| ← thrill_seeker left | 16:20 |
| → thrill_seeker joined | 16:21 |
| ← caterfxo left | 16:21 |
| ← thrill_seeker left | 16:21 |
| ← fling left | 16:21 |
| → lss joined | 16:21 |
| → thrill_seeker joined | 16:21 |
| ← thrill_seeker left | 16:21 |
| → caterfxo joined | 16:22 |
|
j416
| nkz: someone posted an image of exactly this scenario just a while ago; https://i.snipboard.io/9goF0P.jpg | 16:22 |
|
| well, close enough. | 16:22 |
| → Guest20 joined | 16:22 |
|
j416
| if git can fast-forward, it'll do that by default. | 16:23 |
| → thrill_seeker joined | 16:23 |
| ← aliss left | 16:23 |
| ← DevAntoine left | 16:23 |
| ← thrill_seeker left | 16:23 |
| → thrill_seeker joined | 16:24 |
| ← thrill_seeker left | 16:24 |
| → thrill_seeker joined | 16:24 |
| ← thrill_seeker left | 16:24 |
| → sgn1 joined | 16:24 |
|
nkz
| j416: thank you. I understand now | 16:24 |
| → thrill_seeker joined | 16:25 |
| → DevAntoine joined | 16:25 |
| ← sgn left | 16:28 |
| → moviuro joined | 16:28 |
| → madewokherd joined | 16:28 |
| → Raging_Hog joined | 16:29 |
| ← DevAntoine left | 16:29 |
| → fling joined | 16:29 |
| → wnbeser joined | 16:30 |
| → heyitsrama joined | 16:30 |
|
j416
| o/ | 16:32 |
| ← spacesuitdiver left | 16:36 |
| ← nkz left | 16:38 |
| → gast0n joined | 16:38 |
| → stats4647 joined | 16:39 |
| → shush joined | 16:42 |
| ← tiin57 left | 16:44 |
| → mirrorbird joined | 16:44 |
| → rcoote joined | 16:44 |
| ← bolovanos left | 16:45 |
| ← zebrag left | 16:46 |
| → zebrag joined | 16:46 |
| ← shush left | 16:47 |
| → tiin57 joined | 16:47 |
| → daniele76 joined | 16:48 |
| ← daniele76 left | 16:49 |
| ← lss left | 16:55 |
| → aliss joined | 16:55 |
| ← mozgalom left | 16:55 |
| → shivam_ joined | 17:01 |
| → shush joined | 17:01 |
| → aquery joined | 17:01 |
| ← Guest20 left | 17:01 |
| ← shivam_ left | 17:05 |
|
aquery
| Hello all, I'm a bit confused, hope you can help me. I wanted do create a pull-request for a project using git (codeberg.org). I forked it, cloned the forked repo, pushed my changes and submitted a pull request. | 17:05 |
| ← Haohmaru left | 17:07 |
|
aquery
| It got accepted and all is good. But the forked repo didn't go anywhere, it's still sitting there. Now I have a new feature (in the same project) that I need to develope. But I can't fork the master branch - because that forked repo is still sitting there! | 17:07 |
| ← Hello71 left | 17:07 |
|
ikke
| You need to fork only once | 17:07 |
|
| You update that fork through your local repo | 17:07 |
|
| Generally, you fetch the main branch from upstream, and create new feature branches, and push those to your fork | 17:08 |
| ← rfuentess left | 17:08 |
| → Hello71 joined | 17:08 |
|
aquery
| ikke: ok, but the master branch has changed since I forked it, and my forked repo doesn't show those changes | 17:08 |
|
ikke
| aquery: generally that does not matter | 17:08 |
|
| not for making pull requests at least | 17:08 |
|
| You add the upstream (the repo you forked from) repo as a remote | 17:09 |
|
| to your local repo | 17:09 |
|
aquery
| Hmmmm that might be the key step I missed. One moment. | 17:10 |
| ← zebrag left | 17:11 |
|
aquery
| ikke: ok so on my local repo, running "git remote get-url --all origin" gives me only one url - to the *forked* repo | 17:12 |
|
ikke
| you could do git remote add upstream <upstream-url> | 17:12 |
|
aquery
| ikke: is that the classic way to do things? I'm trying to realize what step in the workflow I missed. | 17:13 |
|
ikke
| yes, it is | 17:13 |
| ← Technodrome left | 17:13 |
| ← tiin57 left | 17:13 |
| ← caterfxo left | 17:14 |
|
aquery
| ikke: ok cool. I'll do that. After that, git pull origin master should give me the up-to-date repo? | 17:14 |
|
ikke
| no | 17:14 |
|
| you need to fetch from upstream | 17:14 |
|
| origin is your fork, which does not have any changes | 17:14 |
| → OnkelBlade joined | 17:14 |
| → caterfxo joined | 17:14 |
| → zebrag joined | 17:15 |
|
ikke
| git pull --ff-only upstream master (while on master) | 17:15 |
|
aquery
| ikke: oh, ok, right. Let me try it real quick :) | 17:15 |
| → Guest20 joined | 17:16 |
| → spacesuitdiver joined | 17:17 |
| → tiin57 joined | 17:17 |
| ← Muimi left | 17:18 |
| → jl4 joined | 17:18 |
|
aquery
| ikke: awesome. | 17:21 |
|
| ikke: many thanks for your help :)) | 17:22 |
| ← raven-au left | 17:23 |
|
ikke
| np | 17:25 |
| → aesthe joined | 17:27 |
| ← mindCrime left | 17:27 |
| ← aquery left | 17:28 |
| → Technodrome joined | 17:29 |
| ← Sleepy63 left | 17:29 |
| → arcatech joined | 17:31 |
| → Betal joined | 17:33 |
| ← HumanG33k left | 17:36 |
| ← trinityblade left | 17:36 |
| → IvanZhuro joined | 17:36 |
| ← shush left | 17:36 |
| → shush joined | 17:36 |
| ← IvanZhuro left | 17:37 |
| → HumanG33k joined | 17:37 |
| ← shush left | 17:38 |
| → nvmd joined | 17:38 |
| → shush joined | 17:38 |
| → mindCrime joined | 17:38 |
| ← caterfxo left | 17:42 |
| → mozgalom joined | 17:42 |
| → caterfxo joined | 17:43 |
| ← tiin57 left | 17:43 |
| ← HumanG33k left | 17:45 |
| → orbyt_v7 joined | 17:45 |
| ← jaziz1 left | 17:45 |
| ← zebrag left | 17:45 |
| → Guest20_ joined | 17:46 |
| → zebrag joined | 17:46 |
| → Sleepy63 joined | 17:46 |
| → tiin57 joined | 17:47 |
| ← Guest20 left | 17:48 |
| ← zebrag left | 17:49 |
| → HumanG33k joined | 17:51 |
| → kalbasit joined | 17:52 |
| → bn_work joined | 17:53 |
| ← HumanG33k left | 17:54 |
| ← moviuro left | 17:54 |
| ← mindCrime left | 17:54 |
| → HumanG33k joined | 17:55 |
| ← fachinformatiker left | 17:58 |
| → fachinformatiker joined | 18:02 |
| ← fachinformatiker left | 18:02 |
| → fachinformatiker joined | 18:02 |
| → moviuro joined | 18:02 |
| → zebrag joined | 18:03 |
| ← moviuro left | 18:03 |
| → moviuro joined | 18:06 |
| ← chele left | 18:07 |
| → n0mn0m joined | 18:10 |
| → soifou joined | 18:11 |
| ← tiin57 left | 18:13 |
| ← arcatech left | 18:14 |
| ← wnbeser left | 18:16 |
| → tiin57 joined | 18:17 |
| → Wetmelon joined | 18:17 |
| ← nabil__ left | 18:17 |
| ← mirrorbird left | 18:19 |
| n0mn0m → n0mn0m[away] | 18:20 |
| ← wootehfoot left | 18:20 |
| ← n0mn0m[away] left | 18:20 |
| → dqx joined | 18:21 |
| ← zebrag left | 18:22 |
| → zebrag joined | 18:23 |
| → cliluw joined | 18:24 |
| → DevAntoine joined | 18:28 |
| ← cliluw left | 18:29 |
| → alyawn joined | 18:33 |
| ← DevAntoine left | 18:34 |
| ← aesthe left | 18:34 |
| ← thrill_seeker left | 18:36 |
| → trinityblade joined | 18:37 |
| → napping joined | 18:37 |
| → plexigras joined | 18:40 |
| → cfoch joined | 18:40 |
| ← DarthRadar left | 18:41 |
| ← tiin57 left | 18:43 |
| ← mellernoia left | 18:46 |
| → aesthe joined | 18:46 |
| → reactormonk joined | 18:47 |
| → mirrorbird joined | 18:47 |
| → tiin57 joined | 18:48 |
| → dionysus69 joined | 18:49 |
| → physikoi joined | 18:51 |
| ← TheConjurer left | 18:52 |
|
physikoi
| #git, does `git reset --hard HEAD~1` permanently delete last commit? I accidentaly did hard instead of soft. I had just commited some changes, but accidentally includes some changes that I didn't want in the commit. So, I tried to undo the commit. Now I'm afraid I lost a lot of work. Help? | 18:53 |
| → arcatech joined | 18:53 |
|
physikoi
| I tried going through reflog, but none of the recent commits in that log bring me back to the state i had been in | 18:54 |
| ← aesthe left | 18:54 |
| → Lord_of_Life_ joined | 18:56 |
| ← Iarfen left | 18:58 |
| → cliluw joined | 18:58 |
| ← Lord_of_Life left | 18:59 |
| Lord_of_Life_ → Lord_of_Life | 18:59 |
| ← luke-jr left | 18:59 |
| → luke-jr joined | 18:59 |
|
imMute
| physikoi: if it's been less than 14 days, that commit should be somewhere in the reflog | 18:59 |
|
physikoi
| it's been less than 2hours | 19:01 |
|
| To be perfectly clear, I did these two things: add all, commit, then `git reset --hard HEAD~1` | 19:02 |
| → gonzo joined | 19:02 |
|
imMute
| definitely should be in the reflog then | 19:03 |
| → amahl_ joined | 19:03 |
| ← amahl_ left | 19:03 |
| → amahl_ joined | 19:04 |
| ← arcatech left | 19:06 |
|
physikoi
| imMute: you're right. Not sure if I took the right next step to recovery (git reset HEAD@{15} in this case). This did unstage those changes. I think i'm good from here. Thank you! | 19:07 |
|
Jitta
| Hi, I would like to use a credential helper for a specific remote (i.e. github) but not for others. Any idea/hints how to do that? | 19:13 |
| ← tiin57 left | 19:13 |
|
shush
| Anyone have some documentation on `:/` syntax? It was mentioned in a article about `git commit --fixup` | 19:14 |
|
physikoi
| Jitta: Like SSH? | 19:14 |
|
shush
| Apparently you can reference a commit by it's message | 19:14 |
|
| I'm wondering if you can reference a commit by it's message and use a specific downstream commit when search upstream | 19:15 |
| ← mirrorbird left | 19:16 |
|
imMute
| shush: can you link to the article? | 19:16 |
|
Jitta
| physikoi: like "git config --global credential.helper xyz" but only for a specific remote | 19:16 |
| → mellernoia joined | 19:16 |
| → arcatech joined | 19:16 |
| → tiin57 joined | 19:17 |
| → wnbeser joined | 19:17 |
| ← Wetmelon left | 19:18 |
| ← Sleepy63 left | 19:18 |
| ← aw1 left | 19:20 |
| ← alyawn left | 19:21 |
| → alyawn joined | 19:21 |
|
shush
| https://thoughtbot.com/blog/autosquashing-git-commits | 19:23 |
| → k3yp- joined | 19:24 |
| ← k3yp left | 19:25 |
|
imMute
| shush: I've never seen that syntax before and it's not mentioned on the git-commit or git-rebase manpages | 19:26 |
| k3yp- → k3yp | 19:26 |
|
shush
| That's intersting | 19:27 |
|
| s/intersting/interesting | 19:28 |
|
j416
| you'll find the syntax in man gitrevisions | 19:28 |
|
gitinfo
| the gitrevisions manpage is available at https://gitirc.eu/gitrevisions.html | 19:28 |
|
osse
| autosquashing is the best kind of squashing | 19:30 |
|
shush
| https://stackoverflow.com/questions/52039149/refer-to-a-git-commit-by-commit-message-headline | 19:30 |
|
j416
| the man page says youngest commit; note that this is by date, not by topology. | 19:31 |
| → Sleepy63 joined | 19:31 |
|
shush
| j416: Is it using the commit date or the author date I wonder | 19:32 |
|
j416
| shush: didn't know about <rev>^/text; thanks. | 19:32 |
|
imMute
| is that commit date or author date? | 19:32 |
|
j416
| I forget. but it should be easy to check. | 19:32 |
|
shush
| j416: Almost: HEAD^{/text} | 19:32 |
|
j416
| shush: HEAD is a revision. | 19:32 |
|
shush
| You forgot the curly brace | 19:32 |
|
j416
| oh, it has to be {} | 19:33 |
|
shush
| It appears so | 19:33 |
|
j416
| makes sense | 19:33 |
|
| indeed; doesn't work without {} | 19:33 |
|
| thanks | 19:33 |
|
shush
| This is pretty cool. Now I have all I need to mimic the way fixup! commits work for rebase | 19:33 |
| ← OnkelBlade left | 19:34 |
|
j416
| the pitfall with the youngest by timestamp rather than topology is that it might pick a commit from say a different branch -- not always what you'd intend | 19:35 |
| → gjergj_kastrioti joined | 19:35 |
|
shush
| Isn't it only looking upstream? | 19:36 |
|
j416
| no | 19:36 |
|
| but for --fixup, as long as you verify that the commit message subject is the correct one, it'll work just fine. All that matters for --fixup is that the subject matches. | 19:37 |
|
shush
| :/<text> will find the one that is reachable from any ref | 19:37 |
|
j416
| yes | 19:37 |
|
shush
| But HEAD^{/<text>} will only search what is reachable from HEAD | 19:38 |
|
j416
| yes. | 19:38 |
|
| but it's quite a bit to type | 19:38 |
| ← gonzo left | 19:38 |
|
shush
| j416: It is | 19:38 |
| ← rsx left | 19:38 |
|
j416
| at that point HEAD~5 or what have you seems faster | 19:38 |
|
shush
| I'm not going to be typing it | 19:38 |
|
j416
| (which can be further shortened to @~5) | 19:38 |
|
shush
| `git portal some-branch` will by my alias | 19:39 |
| → cd joined | 19:39 |
|
napping
| I've been testing different orders of making commits and running gc. How is it that 'git gc --aggressive' helps a later 'git gc' find a better result? The description of pack heuristics at https://git-scm.com/docs/pack-heuristics doesn't seem to mention looking at the old pack | 19:39 |
|
shush
| git rebase --onto ':/future! some-branch' 'HEAD^{/future! some-branch}' | 19:40 |
|
j416
| napping: I don't have your answer, but you may find it interesting to experiment with git-repack. | 19:40 |
|
shush
| That'll move the current branch to the latest "future commit" | 19:40 |
|
j416
| shush: heh. seems like quite the roundabout. | 19:41 |
| ← lacrymology left | 19:41 |
|
shush
| j416: How else can you move a branch that depends another feature branch that isn't yet merged into master? | 19:42 |
|
napping
| j416: its man page mentions git-pack-objects, and a --no-reuse-delta option that sounds relevant | 19:42 |
|
shush
| j416: All while having a commit that stands in place for that merge for the peer-review stage? | 19:43 |
| ← tiin57 left | 19:44 |
|
j416
| shush: I typically just use aforementioned HEAD~<n> syntax, or hashes directly | 19:44 |
|
shush
| How do I test a specific revision? | 19:44 |
|
| Like how can I see what the hash is for a specific revision parameter? | 19:44 |
| → lacrymology joined | 19:44 |
|
j416
| shush: what do you mean by revision parameter? | 19:44 |
|
shush
| j416: Yes, but it'll take longer to create the merge commit, and then deal with rebasing manually | 19:45 |
|
ikke
| git rev-parse <revision> | 19:45 |
|
shush
| j416: A rev param would be HEAD~3 for example | 19:45 |
|
j416
| if you have that, you don't need the hash | 19:45 |
|
| just use HEAD~3, then | 19:45 |
|
shush
| ikke: Thanks | 19:45 |
|
j416
| but, what ikke said. | 19:45 |
|
shush
| j416: It's to confirm things are working | 19:45 |
|
| That my rev works before I use it | 19:45 |
|
| Sure I can just do `git undo` | 19:46 |
|
j416
| unfamiliar with that | 19:46 |
|
shush
| which is an alias for undoing the last change to a branch | 19:46 |
|
| :D | 19:46 |
|
j416
| what about the worktree | 19:46 |
|
shush
| undo = "!f() { git reset --hard $(git here)@{${1:-1}}; }; f" | 19:46 |
|
j416
| scary | 19:47 |
|
shush
| scary how? | 19:47 |
|
j416
| if you hadn't committed and did git undo | 19:47 |
|
| but, of course that goes for reset --hard itself, too. | 19:47 |
| → tiin57 joined | 19:47 |
|
shush
| Then you looks your worktree | 19:47 |
| ← mozgalom left | 19:47 |
|
j416
| just thought undo seems more.. harmless | 19:47 |
|
shush
| I'm open to suggestions | 19:48 |
|
| --soft then? | 19:48 |
|
| or --mixed | 19:48 |
|
j416
| do whatever you prefer :) | 19:48 |
|
shush
| Well, it would be good to not lose changes that haven't been checked in | 19:48 |
|
| But I don't want to keeps all the shit that was undo | 19:48 |
|
j416
| commit or stash them? | 19:48 |
|
shush
| undone* | 19:48 |
|
| do a git stash and then pop between the reset | 19:49 |
| ← Technodrome left | 19:49 |
|
shush
| Maybe warn the user of undo that the worktree or index must be empty? | 19:49 |
|
| I wouldn't know how to do that check... | 19:49 |
| → thiago joined | 19:50 |
|
j416
| shush: read -p "rly do this [y/n]? " -n 1 -r | 19:50 |
|
| maybe | 19:50 |
|
| (and then you check $REPLY) | 19:51 |
|
| seems like a lot of effort though | 19:51 |
| → Narrat joined | 19:52 |
| ← gast0n left | 19:52 |
| ← lacrymology left | 19:53 |
| → vdamewood joined | 19:54 |
|
shush
| How do I turn a branch name into a symbolic ref? | 19:54 |
|
napping
| Ah, looks like git gc runs git repack with -f only for --aggressive | 19:54 |
| → wootehfoot joined | 19:55 |
| ← epoll left | 19:55 |
|
j416
| shush: do you mean you want the full ref? | 19:56 |
| → epoll joined | 19:56 |
|
j416
| shush: git rev-parse --symbolic-full-name <branch> | 19:56 |
|
shush
| j416: Well `git parse-rev branch^{:/commit text}` wont work | 19:56 |
|
j416
| shush: try rev-parse instead | 19:57 |
| → manj-gnome joined | 19:57 |
|
j416
| (also skip the :) | 19:58 |
|
shush
| I miss typed | 19:58 |
|
| I'm using rev-parse | 19:58 |
|
j416
| then it'll work fine | 19:58 |
|
| what's the issue? | 19:58 |
| ← jl4 left | 20:00 |
| → nabil joined | 20:00 |
|
shush
| `git rev-parse branch` returns fatal: ambiguous argument 'branch': unknown revision or path not in the working tree. | 20:00 |
| → TheConjurer joined | 20:00 |
| ← arcatech left | 20:00 |
| ← manj-gnome left | 20:01 |
|
thiago
| does it exist as abranch? | 20:01 |
|
j416
| shush: does it actually say 'branch', or 'branch^{:/commit text}' ? | 20:02 |
|
shush
| Ah, | 20:02 |
|
| I was messing up | 20:02 |
|
| looks like it works | 20:02 |
| ← p-core left | 20:02 |
|
shush
| Needed ^{/ after my branch | 20:02 |
| ← riksteri left | 20:02 |
|
j416
| ..yes. | 20:02 |
|
shush
| I think I had {/ only | 20:03 |
| → p-core joined | 20:03 |
|
shush
| And also there was no commit matching my text on the branch I was testing | 20:03 |
| → nabil_ joined | 20:03 |
|
shush
| Btw | 20:03 |
| ← napping left | 20:04 |
|
shush
| HEAD^{/text} can be shorter: @^{/text} which is only 3 more characters than :/text | 20:04 |
|
j416
| shush: note that all of this relies on your commits having different subjects. If you have two commits that are "Update docs" or such, it'll only ever find one of them. | 20:04 |
|
shush
| j416: Yes | 20:04 |
|
| The commit message will always be formatted as "future! branch-name" | 20:04 |
| ← nabil left | 20:05 |
| ← cliluw left | 20:06 |
|
shush
| This way I can do `git portal upstream downstream` which translates to `git rebase --onto @^{/future! upstream} downstream^{/future! upstream} downstream` | 20:06 |
|
| Of course to create the "future!" commit, I'd have `git future branch` which will do `git merge -m"future! branch" branch` | 20:08 |
|
| That's the workflow I'm thinking of using | 20:08 |
| ← plexigras left | 20:08 |
| → nomadicmathmo joined | 20:11 |
| ← R2robot left | 20:11 |
| → vs^ joined | 20:11 |
| ← Borkr left | 20:13 |
| ← tiin57 left | 20:13 |
| → tiin57 joined | 20:17 |
| ← redcaptrickster left | 20:19 |
| ← p-core left | 20:20 |
| ← toolbox left | 20:20 |
| → kupi joined | 20:22 |
| ← GankMove left | 20:23 |
| → jnavila joined | 20:23 |
| ← HumanG33k left | 20:24 |
| → cliluw joined | 20:27 |
| ← vdamewood left | 20:27 |
| ← cliluw left | 20:30 |
| → cliluw joined | 20:31 |
| → rossome joined | 20:31 |
| ← cliluw left | 20:35 |
| → otisolsen70_ joined | 20:36 |
| ← Gustavo6046 left | 20:37 |
| carbolymer_ → carbolymer | 20:38 |
| → p-core joined | 20:39 |
| → laria joined | 20:39 |
| ← otisolsen70 left | 20:40 |
| → Iarfen joined | 20:43 |
| ← tiin57 left | 20:43 |
| → HumanG33k joined | 20:45 |
| ← Narrat left | 20:45 |
| → erin1983684 joined | 20:46 |
| → tiin57 joined | 20:47 |
| ← erin1983684 left | 20:49 |
| → erin1983684 joined | 20:49 |
| ← erin1983684 left | 20:50 |
| → Narrat joined | 20:51 |
| ← otisolsen70_ left | 20:51 |
| ← mellernoia left | 20:51 |
| → BrunoSpr joined | 20:54 |
| → codebam__ joined | 20:55 |
| ← trinityblade left | 20:55 |
| ← codebam_ left | 20:57 |
| → Gustavo6046 joined | 20:58 |
| ← spacesuitdiver left | 20:59 |
| → justanotheruser joined | 20:59 |
| → otisolsen70 joined | 21:00 |
| ← wnbeser left | 21:04 |
| → bolovanos joined | 21:05 |
| → cliluw joined | 21:08 |
| ← nomadicmathmo left | 21:09 |
| → spacesuitdiver joined | 21:10 |
| ← Maxattax left | 21:11 |
| ← dionysus69 left | 21:13 |
| → nomadicmathmo joined | 21:13 |
| ← tiin57 left | 21:14 |
| → dionysus69 joined | 21:14 |
| → jstein joined | 21:14 |
| → Wetmelon joined | 21:15 |
| ← dwmw2_gone left | 21:15 |
| ← ghost43 left | 21:15 |
| → ghost43 joined | 21:15 |
| → arcatech joined | 21:16 |
| → tiin57 joined | 21:17 |
| ← kalbasit left | 21:20 |
| ← aliss left | 21:21 |
| ← BrunoSpr left | 21:22 |
| ← vs^ left | 21:22 |
| ← Gustavo6046 left | 21:26 |
| ← Xiti left | 21:30 |
| ← Atlenohen left | 21:31 |
| → Gustavo6046 joined | 21:33 |
| ← laria left | 21:33 |
| ← Raging_Hog left | 21:34 |
| → dwmw2_gone joined | 21:35 |
| → osse joined | 21:35 |
| → gonzo joined | 21:36 |
| ← sord937 left | 21:38 |
| ← dwmw2_gone left | 21:40 |
| ← rcoote left | 21:43 |
| ← tiin57 left | 21:44 |
| → BrunoSpr joined | 21:46 |
| → tiin57 joined | 21:47 |
| → shored1 joined | 21:48 |
| ← gonzo left | 21:48 |
| ← Sleepy63 left | 21:48 |
| ← shush left | 21:51 |
| → shush joined | 21:52 |
| ← Guest20_ left | 21:52 |
| ← Wetmelon left | 21:52 |
| → FFY00 joined | 21:53 |
| ← nomadicmathmo left | 21:54 |
| → trinityblade joined | 21:56 |
| ← cfoch left | 22:00 |
| ← dionysus69 left | 22:01 |
| → lofo_ joined | 22:01 |
| ← __Aqua_Vitae__ left | 22:02 |
| ← TheConjurer left | 22:05 |
| ← lofo left | 22:05 |
| → TheConjurer joined | 22:06 |
| → tsrt^ joined | 22:07 |
| → Sleepy63 joined | 22:07 |
| ← caveman left | 22:07 |
| ← tiin57 left | 22:13 |
| ← cliluw left | 22:15 |
| → dwmw2_gone joined | 22:16 |
| → tiin57 joined | 22:17 |
| ← crose left | 22:18 |
| ← jnavila left | 22:20 |
| → mirrorbird joined | 22:21 |
| ← endiruna1 left | 22:22 |
| ← mirrorbird left | 22:22 |
| → gigasu_shida joined | 22:22 |
| → durham joined | 22:23 |
| ← BrunoSpr left | 22:25 |
| ← theoceaniscool left | 22:29 |
| ← orbyt_v7 left | 22:30 |
| → gast0n joined | 22:35 |
| ← durham left | 22:40 |
| → durham joined | 22:40 |
| → cliluw joined | 22:41 |
| ← tiin57 left | 22:43 |
| ← dwmw2_gone left | 22:44 |
| → dwmw2_gone joined | 22:44 |
| → Wetmelon joined | 22:45 |
| ← dwmw2_gone left | 22:45 |
| → dwmw2_gone joined | 22:45 |
| → tiin57 joined | 22:47 |
| ← otisolsen70 left | 22:48 |
| ← calcul0n__ left | 22:51 |
| → devslash joined | 22:54 |
|
devslash
| I did git add . on my repo but meant to add only 1 file | 22:55 |
|
| how do i undo add . | 22:55 |
|
zsoc
| git reset | 22:55 |
|
devslash
| ok thanks | 22:55 |
| ← arcatech left | 23:01 |
|
ackyshake
| git reset -p if you want to unstage selectively, while keeping the file you want, staged. | 23:03 |
|
| or git reset <file> | 23:03 |
| → royal_screwup21 joined | 23:03 |
| → Xiti joined | 23:09 |
| ← gigasu_shida left | 23:11 |
| → n0mn0m[away] joined | 23:12 |
| ← luke-jr left | 23:12 |
| → gigasu_shida joined | 23:12 |
| → luke-jr joined | 23:13 |
| ← n0mn0m[away] left | 23:13 |
| ← tiin57 left | 23:13 |
| → tiin57 joined | 23:18 |
| → arcatech joined | 23:19 |
| ← dwmw2_gone left | 23:20 |
| → Benzi-Junior joined | 23:20 |
| ← jstein left | 23:21 |
| → dwmw2_gone joined | 23:21 |
| → sgn joined | 23:29 |
| ← sgn1 left | 23:30 |
| ← durham left | 23:32 |
| ← m0viefreak left | 23:37 |
| → karvad joined | 23:41 |
| ← dudek left | 23:41 |
| ← tiin57 left | 23:43 |
| ← DiffieHellman left | 23:43 |
| → DiffieHellman joined | 23:45 |
| → codebam_ joined | 23:46 |
| → tiin57 joined | 23:47 |
| → orbyt_ joined | 23:48 |
| ← codebam__ left | 23:48 |
| ← royal_screwup21 left | 23:51 |
| → royal_screwup21 joined | 23:51 |
| → codebam__ joined | 23:51 |
| ← Betal left | 23:52 |
| ← herren left | 23:53 |
| ← codebam_ left | 23:54 |
| → Thorn joined | 23:54 |
| → powerhouse joined | 23:54 |
| → sudoforge joined | 23:57 |
| → durham_ joined | 23:59 |