├── .github └── FUNDING.yml ├── README.md └── Software_Engineering__git.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: Stvad 2 | patreon: stvad 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git Anki deck. (CrowdAnki JSON) 2 | This deck consists of 2 sub-decks - one focused on the git commands, another on git concepts. 3 | 4 | Incorporates some parts from shared decks provided on AnkiWeb. 5 | 6 | In order to use this deck and to contribute back - please use the CrowdAnki plugin: https://github.com/Stvad/CrowdAnki 7 | 8 | You're welcome to use and improve this deck! 9 | -------------------------------------------------------------------------------- /Software_Engineering__git.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "Deck", 3 | "children": [ 4 | { 5 | "__type__": "Deck", 6 | "children": [], 7 | "crowdanki_uuid": "a69e2b7a-6d5b-11e6-adf3-8c705a50cbf0", 8 | "deck_config_uuid": "a69e3016-6d5b-11e6-adf3-8c705a50cbf0", 9 | "desc": "Please see the shared deck page for more info.", 10 | "dyn": 0, 11 | "extendNew": 10, 12 | "extendRev": 50, 13 | "media_files": [], 14 | "mid": 1408638528289, 15 | "name": "General Information", 16 | "notes": [ 17 | { 18 | "__type__": "Note", 19 | "data": "", 20 | "fields": [ 21 | "What is the main characteristic of a distributed\n version control system\n (DVCS)?", 22 | "A distributed version control system has no\n central server which\n stores the data. Every local copy contains the full history of the\n source code.\n \n " 23 | ], 24 | "flags": 0, 25 | "guid": "b#GLS`mD*f", 26 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 27 | "tags": [] 28 | }, 29 | { 30 | "__type__": "Note", 31 | "data": "", 32 | "fields": [ 33 | "Does the use of a\n DVCS require a\n central\n code\n repository?\n \n ", 34 | "No." 35 | ], 36 | "flags": 0, 37 | "guid": "CPlCr{/4m(", 38 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 39 | "tags": [] 40 | }, 41 | { 42 | "__type__": "Note", 43 | "data": "", 44 | "fields": [ 45 | "Where does Git\n commit file changes to?
", 46 | "To the local repository." 47 | ], 48 | "flags": 0, 49 | "guid": "O9BDWhx,@(", 50 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 51 | "tags": [] 52 | }, 53 | { 54 | "__type__": "Note", 55 | "data": "", 56 | "fields": [ 57 | "What happens when you clone a\n repository with Git?", 58 | "An exact copy of the\n repository is created locally.
" 59 | ], 60 | "flags": 0, 61 | "guid": "Dkiv9+0iTX", 62 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 63 | "tags": [] 64 | }, 65 | { 66 | "__type__": "Note", 67 | "data": "", 68 | "fields": [ 69 | "Does the local clone of a remote repository include the\n complete history of the source code?", 70 | "Yes." 71 | ], 72 | "flags": 0, 73 | "guid": "M,[&ZR-I$S", 74 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 75 | "tags": [] 76 | }, 77 | { 78 | "__type__": "Note", 79 | "data": "", 80 | "fields": [ 81 | "What's the meaning of master branch?", 82 | "The \"master\" in Git is the default branch, which generally represents the most stable code." 83 | ], 84 | "flags": 0, 85 | "guid": "bm{uO(^4b/", 86 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 87 | "tags": [] 88 | }, 89 | { 90 | "__type__": "Note", 91 | "data": "", 92 | "fields": [ 93 | "What is a commit?", 94 | "A commit is a pointer to a spot (revision) on the code history." 95 | ], 96 | "flags": 0, 97 | "guid": "LknXA>P{gu", 98 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 99 | "tags": [] 100 | }, 101 | { 102 | "__type__": "Note", 103 | "data": "", 104 | "fields": [ 105 | "How are Git commits identified?", 106 | "Instead of numbering commits, Git uses the code contents of the commit to create a unique, 40 character SHA-1 hash." 107 | ], 108 | "flags": 0, 109 | "guid": "M!|;;-isLS", 110 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 111 | "tags": [] 112 | }, 113 | { 114 | "__type__": "Note", 115 | "data": "", 116 | "fields": [ 117 | "Does a branch created in a repository, which was cloned from another repository, need to have a counterpart in the remote repository?
", 118 | "No it doesn't." 119 | ], 120 | "flags": 0, 121 | "guid": "cr,S-na/4y", 122 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 123 | "tags": [] 124 | }, 125 | { 126 | "__type__": "Note", 127 | "data": "", 128 | "fields": [ 129 | "Which two steps are neccessary to persist modifications on a file in the repository?
", 130 | "1. Staging (mark the file to be relevant for Git) = adding the file to the index.
2. Commiting: storing the changes in the Git repository.
" 131 | ], 132 | "flags": 0, 133 | "guid": "wp*ChGY&nd", 134 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 135 | "tags": [] 136 | }, 137 | { 138 | "__type__": "Note", 139 | "data": "", 140 | "fields": [ 141 | "What does the term staging describe?", 142 | "Marking changes as relevant for the version control, by adding them to the index." 143 | ], 144 | "flags": 0, 145 | "guid": "s2b*|BtuO2", 146 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 147 | "tags": [] 148 | }, 149 | { 150 | "__type__": "Note", 151 | "data": "", 152 | "fields": [ 153 | "What is a Revision?
", 154 | "A revision represents a version of the source code. Git identifies\n revisions\n with SHA-1 IDs using a commit object. SHA-1 IDs are 160 bits long and are\n represented\n in\n hexadecimal. The latest version can be addressed\n via\n HEAD, the version before that via\n HEAD~1\n and so on." 155 | ], 156 | "flags": 0, 157 | "guid": "DF$yg5cnTs", 158 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 159 | "tags": [] 160 | }, 161 | { 162 | "__type__": "Note", 163 | "data": "", 164 | "fields": [ 165 | "In which file does Git store global settings?
", 166 | "In the .gitconfig file.
" 167 | ], 168 | "flags": 0, 169 | "guid": "cq9}90`8%l", 170 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 171 | "tags": [] 172 | }, 173 | { 174 | "__type__": "Note", 175 | "data": "", 176 | "fields": [ 177 | "Which file tells Git which files and directories to ignore?
", 178 | "
.gitignore
" 179 | ], 180 | "flags": 0, 181 | "guid": "p{@pLqf8~)", 182 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 183 | "tags": [] 184 | }, 185 | { 186 | "__type__": "Note", 187 | "data": "", 188 | "fields": [ 189 | "What is the difference between local .gitignore and global .gitignore files, regarding visibility?
", 190 | "The local\n .gitignore\n file can be committed into the Git repository and\n therefore is visible\n to everyone who clones the repository. The\n global\n .gitignore\n file is only\n locally visible.\n \n " 191 | ], 192 | "flags": 0, 193 | "guid": "bALcFrS[,0", 194 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 195 | "tags": [] 196 | }, 197 | { 198 | "__type__": "Note", 199 | "data": "", 200 | "fields": [ 201 | "How are empty directories handled under Git version control / by common practice?", 202 | "Git ignores empty directories, i.e. it does not put them under version control. Common practice for tracking an empty directory though, is to put a file called .gitkeep into such a directory.
" 203 | ], 204 | "flags": 0, 205 | "guid": "julVRci`rj", 206 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 207 | "tags": [] 208 | }, 209 | { 210 | "__type__": "Note", 211 | "data": "", 212 | "fields": [ 213 | "What does the command git reflog do?
", 214 | "It displays the history of the complete changes of the current branch, based on the HEAD revision.
" 215 | ], 216 | "flags": 0, 217 | "guid": "s$go8!a4M`", 218 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 219 | "tags": [] 220 | }, 221 | { 222 | "__type__": "Note", 223 | "data": "", 224 | "fields": [ 225 | "Does git reflog also contain deleted commits?", 226 | "Yes." 227 | ], 228 | "flags": 0, 229 | "guid": "o7*md3rMpY", 230 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 231 | "tags": [] 232 | }, 233 | { 234 | "__type__": "Note", 235 | "data": "", 236 | "fields": [ 237 | "How is the default branch called in Git?
", 238 | "Master." 239 | ], 240 | "flags": 0, 241 | "guid": "KQ=K|X^!V@", 242 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 243 | "tags": [] 244 | }, 245 | { 246 | "__type__": "Note", 247 | "data": "", 248 | "fields": [ 249 | "What does the term merging describe?
", 250 | "The process of combining changes of two branches." 251 | ], 252 | "flags": 0, 253 | "guid": "IMAr1$Qa%~", 254 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 255 | "tags": [] 256 | }, 257 | { 258 | "__type__": "Note", 259 | "data": "", 260 | "fields": [ 261 | "What is a merge conflict?
", 262 | "A merge conflict occurs, if two people have modified the same content and Git cannot automatically determine how both changes should be applied.
" 263 | ], 264 | "flags": 0, 265 | "guid": "u}r83:+:~S", 266 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 267 | "tags": [] 268 | }, 269 | { 270 | "__type__": "Note", 271 | "data": "", 272 | "fields": [ 273 | "What does the rebase command do?
", 274 | "In general terms - rewrites history. E.g: Combining several commits into
one commit. Or replaying changes from one branch on top of the other." 275 | ], 276 | "flags": 0, 277 | "guid": "ioQ[YMk002", 278 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 279 | "tags": [] 280 | }, 281 | { 282 | "__type__": "Note", 283 | "data": "", 284 | "fields": [ 285 | "What functionality does the stash command add?
", 286 | "Saving the current uncommmitted changes and checkout the last committed revision. This allows pulling-in the latest changes or to develop an urgent fix. Afterwards the stashed changes can be restored, which will reapply the changes to the current version of the source code.
" 287 | ], 288 | "flags": 0, 289 | "guid": "i`-!UI5`9n", 290 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 291 | "tags": [] 292 | }, 293 | { 294 | "__type__": "Note", 295 | "data": "", 296 | "fields": [ 297 | "What's the rule of thumb, concerning the stash command?
", 298 | "It should be the exception to using Git. Typically you would create new branches for new features and switch between branches.
" 299 | ], 300 | "flags": 0, 301 | "guid": "My4;,HZvH:", 302 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 303 | "tags": [] 304 | }, 305 | { 306 | "__type__": "Note", 307 | "data": "", 308 | "fields": [ 309 | "What is a patch file?
", 310 | "A text file that contains changes to the source code." 311 | ], 312 | "flags": 0, 313 | "guid": "m5arfU*|ZX", 314 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 315 | "tags": [] 316 | }, 317 | { 318 | "__type__": "Note", 319 | "data": "", 320 | "fields": [ 321 | "What is an alias in Git?", 322 | "An alias in Git allows you to setup your own Git command. E.g. you can define an alias which is a short form of your own favorite commands or you can combine several commands with an alias." 323 | ], 324 | "flags": 0, 325 | "guid": "PE`j{-UNE?", 326 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 327 | "tags": [] 328 | }, 329 | { 330 | "__type__": "Note", 331 | "data": "", 332 | "fields": [ 333 | "Name two transport types that are supported protocols for Git checkouts", 334 | "The native Git protocol is git, alternatively the http protocol is also supported." 335 | ], 336 | "flags": 0, 337 | "guid": "BKdJzcloning a remote repository?
", 346 | "The original repository will automatically be called \"origin\".
" 347 | ], 348 | "flags": 0, 349 | "guid": "xDNKnks;P;", 350 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 351 | "tags": [] 352 | }, 353 | { 354 | "__type__": "Note", 355 | "data": "", 356 | "fields": [ 357 | "What is the possibility of using the HTTP protocol with Git especially helpful for?", 358 | "If a firewall blocks all requests other than http.
" 359 | ], 360 | "flags": 0, 361 | "guid": "ykx4hD1f`?", 362 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 363 | "tags": [] 364 | }, 365 | { 366 | "__type__": "Note", 367 | "data": "", 368 | "fields": [ 369 | "Which are the two variants of ssh keys?
", 370 | "Public and private.
" 371 | ], 372 | "flags": 0, 373 | "guid": "K5v/_?3y;F", 374 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 375 | "tags": [] 376 | }, 377 | { 378 | "__type__": "Note", 379 | "data": "", 380 | "fields": [ 381 | "What does rev~ stand for?", 382 | "The first parent of a revision \"rev\"" 383 | ], 384 | "flags": 0, 385 | "guid": "NvGA`?8=%", 386 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 387 | "tags": [] 388 | }, 389 | { 390 | "__type__": "Note", 391 | "data": "", 392 | "fields": [ 393 | "What is the starting point of the scope of .gitignore files?", 394 | "They define ignore definitions for the whole directory tree, starting from the point where the .gitignore file itself resides." 395 | ], 396 | "flags": 0, 397 | "guid": "op.FKBEmgit pull and git fetch? (In the simplest terms)", 406 | "git pull does a git fetch followed by a git merge." 407 | ], 408 | "flags": 0, 409 | "guid": "j@2Mww$9I{", 410 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 411 | "tags": [] 412 | }, 413 | { 414 | "__type__": "Note", 415 | "data": "", 416 | "fields": [ 417 | "What is the difference between git commit and git push?", 418 | "commit: adding changes to the repository.
push: to transfer the last commit(s) to a remote server
" 419 | ], 420 | "flags": 0, 421 | "guid": "n/=o]SCdPT", 422 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 423 | "tags": [] 424 | }, 425 | { 426 | "__type__": "Note", 427 | "data": "", 428 | "fields": [ 429 | "What is the head in Git?", 430 | "The head is a pointer to the current branch, which is in turn the last commit you made or checked out into your working directory." 431 | ], 432 | "flags": 0, 433 | "guid": "Dgx!t", 434 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 435 | "tags": [] 436 | }, 437 | { 438 | "__type__": "Note", 439 | "data": "", 440 | "fields": [ 441 | "What is the index in Git?", 442 | "It's a snapshot of changes contained in your next commit, this way it's the \"proposed next commit\"." 443 | ], 444 | "flags": 0, 445 | "guid": "KRd1.", 446 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 447 | "tags": [] 448 | }, 449 | { 450 | "__type__": "Note", 451 | "data": "", 452 | "fields": [ 453 | "What does head^ mean?", 454 | "It means the first parent of the tip of the current branch." 455 | ], 456 | "flags": 0, 457 | "guid": "gTh:E.xGT7", 458 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 459 | "tags": [] 460 | }, 461 | { 462 | "__type__": "Note", 463 | "data": "", 464 | "fields": [ 465 | "What is the difference between head~ and head^ ?", 466 | " ~<n> means the revision that is the <n>th generation ancestor of the named revision, following only the first parents.
^<n> means the <n>th parent of that revision.
" 467 | ], 468 | "flags": 0, 469 | "guid": "oSbQ@6YX3O", 470 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 471 | "tags": [] 472 | }, 473 | { 474 | "__type__": "Note", 475 | "data": "", 476 | "fields": [ 477 | "What is a local version control system?", 478 | "A database of changes kept on the same computer as the files being versioned." 479 | ], 480 | "flags": 0, 481 | "guid": "lyLiO", 482 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 483 | "tags": [] 484 | }, 485 | { 486 | "__type__": "Note", 487 | "data": "", 488 | "fields": [ 489 | "How is a distributed version control system different from others?", 490 | "Every client has a full backup of all the data." 491 | ], 492 | "flags": 0, 493 | "guid": "vL>PF", 494 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 495 | "tags": [] 496 | }, 497 | { 498 | "__type__": "Note", 499 | "data": "", 500 | "fields": [ 501 | "What is the \"snapshot\" concept?", 502 | "In Git, the data is more like a stream of complete snapshots of a mini filesystem rather than a list of file changes like you'll see in SVN, Perforce, etc." 503 | ], 504 | "flags": 0, 505 | "guid": "[=E+4", 506 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 507 | "tags": [] 508 | }, 509 | { 510 | "__type__": "Note", 511 | "data": "", 512 | "fields": [ 513 | "Why are most git operations so fast?
", 514 | "They happen on the local disk, rather than over a network
" 515 | ], 516 | "flags": 0, 517 | "guid": "nWWq:b)^~N", 518 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 519 | "tags": [] 520 | }, 521 | { 522 | "__type__": "Note", 523 | "data": "", 524 | "fields": [ 525 | "How does git maintain file integrity?
", 526 | "Everything is SHA-1 checksummed and stored not by filename, but rather hash value of each file's contents.
" 527 | ], 528 | "flags": 0, 529 | "guid": "j-w#1jS:X.", 530 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 531 | "tags": [] 532 | }, 533 | { 534 | "__type__": "Note", 535 | "data": "", 536 | "fields": [ 537 | "What are the 3 git states your files can reside in?
", 538 | "committed, modified, and staged
" 539 | ], 540 | "flags": 0, 541 | "guid": "C4^;Av:G|V", 542 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 543 | "tags": [] 544 | }, 545 | { 546 | "__type__": "Note", 547 | "data": "", 548 | "fields": [ 549 | "What does it mean when a file is in the \"committed\" state?
", 550 | "The data is safely stored in your local database
" 551 | ], 552 | "flags": 0, 553 | "guid": "d1B#YWuY@B", 554 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 555 | "tags": [] 556 | }, 557 | { 558 | "__type__": "Note", 559 | "data": "", 560 | "fields": [ 561 | "What does it mean if a file is in the \"modified\" state?
", 562 | "You have changed the file, but not yet committed it.
" 563 | ], 564 | "flags": 0, 565 | "guid": "B*=9usvjro", 566 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 567 | "tags": [] 568 | }, 569 | { 570 | "__type__": "Note", 571 | "data": "", 572 | "fields": [ 573 | "What does it mean if a file is in the \"staged\" state?
", 574 | "You have marked a file in its current state to go into the next commit snapshot.
" 575 | ], 576 | "flags": 0, 577 | "guid": "fZB+bI=,I[", 578 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 579 | "tags": [] 580 | }, 581 | { 582 | "__type__": "Note", 583 | "data": "", 584 | "fields": [ 585 | "What are the 3 sections of a git project?
", 586 | "the Git directory (repository), the working directory, and the staging area
" 587 | ], 588 | "flags": 0, 589 | "guid": "exQD~)OGAp", 590 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 591 | "tags": [] 592 | }, 593 | { 594 | "__type__": "Note", 595 | "data": "", 596 | "fields": [ 597 | "What is stored in the Git directory?
", 598 | "The metadata and object database for your project
" 599 | ], 600 | "flags": 0, 601 | "guid": "tE7lTjYc[[", 602 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 603 | "tags": [] 604 | }, 605 | { 606 | "__type__": "Note", 607 | "data": "", 608 | "fields": [ 609 | "What is copied when you clone a repository from another computer?
", 610 | "the Git directory
" 611 | ], 612 | "flags": 0, 613 | "guid": "k,m+XqcVpU", 614 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 615 | "tags": [] 616 | }, 617 | { 618 | "__type__": "Note", 619 | "data": "", 620 | "fields": [ 621 | "What is the working directory?
", 622 | "A single checkout of one version of the project. These files are pulled out of the compressed database in the git directory and placed on disk for you to use and modify.
" 623 | ], 624 | "flags": 0, 625 | "guid": "K.$%A~oaD9", 626 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 627 | "tags": [] 628 | }, 629 | { 630 | "__type__": "Note", 631 | "data": "", 632 | "fields": [ 633 | "What is the staging area?", 634 | "It is a file in the git directory that stores information about what goes into the next commit. It is sometimes referred to as the \"index\"." 635 | ], 636 | "flags": 0, 637 | "guid": "L41A}A*]ro", 638 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 639 | "tags": [] 640 | }, 641 | { 642 | "__type__": "Note", 643 | "data": "", 644 | "fields": [ 645 | "What is the 3-step basic git workflow?", 646 | "1. modify files in working directory
2. stage files, adding snapshots of them to the staging area
3. commit, which takes the files in the staging area and stores that snapshot permanently to your git directory
" 647 | ], 648 | "flags": 0, 649 | "guid": "F*ctH#)=J&", 650 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 651 | "tags": [] 652 | }, 653 | { 654 | "__type__": "Note", 655 | "data": "", 656 | "fields": [ 657 | "Where are the three places that git config variables can be stored?", 658 | "1. systemwide:  /etc/gitconfig
2. per user: ~/.gitconfig or ~/.config/git/config
3. per project: .git/config
" 659 | ], 660 | "flags": 0, 661 | "guid": "u(@cQ2. git <verb> --help
3. man git-<verb>
" 695 | ], 696 | "flags": 0, 697 | "guid": "O`8m5XL4n_", 698 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 699 | "tags": [] 700 | }, 701 | { 702 | "__type__": "Note", 703 | "data": "", 704 | "fields": [ 705 | "How do you get a copy of an existing git repository, say https://github.com/libgit2/libgit2?
", 706 | "git clone https://github.com/libgit2/libgit2" 707 | ], 708 | "flags": 0, 709 | "guid": "o=}nL8EYm$", 710 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 711 | "tags": [] 712 | }, 713 | { 714 | "__type__": "Note", 715 | "data": "", 716 | "fields": [ 717 | "What are a couple different transfer protocols used by git?", 718 | "https://
git://
" 719 | ], 720 | "flags": 0, 721 | "guid": "A}1)?]T`vM", 722 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 723 | "tags": [] 724 | }, 725 | { 726 | "__type__": "Note", 727 | "data": "", 728 | "fields": [ 729 | "What is the difference between a tracked and untracked file?", 730 | "Tracked files are all files that were in the last snapshot. They can be unmodified, modified, or staged. Untracked files are not in the latest snapshot or staged." 731 | ], 732 | "flags": 0, 733 | "guid": "Q`hDEs1([I", 734 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 735 | "tags": [] 736 | }, 737 | { 738 | "__type__": "Note", 739 | "data": "", 740 | "fields": [ 741 | "Why is it possible for a tracked file to be both in staging and modified state?", 742 | "Because the staged version is the contents of the file at the exact time you ran \"git add\" to stage the file. You have to run \"git add\" again if you've modified it and want to stage the latest contents of the file." 743 | ], 744 | "flags": 0, 745 | "guid": "Ft&|}kHYmQ", 746 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 747 | "tags": [] 748 | }, 749 | { 750 | "__type__": "Note", 751 | "data": "", 752 | "fields": [ 753 | "What file is used to ignore some untracked files?", 754 | ".gitignore" 755 | ], 756 | "flags": 0, 757 | "guid": "A(Pz~1U7* author's name and email
* commit message
* pointer to the commit(s) directly before this one
" 791 | ], 792 | "flags": 0, 793 | "guid": "s]So>?/9M3;E", 818 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 819 | "tags": [] 820 | }, 821 | { 822 | "__type__": "Note", 823 | "data": "", 824 | "fields": [ 825 | "What happens to the HEAD pointer when you create a new branch?", 826 | "Nothing, it continues to point to the existing branch (such as master, if you haven't changed it yet). It does not switch to the new branch automatically." 827 | ], 828 | "flags": 0, 829 | "guid": "rSIJ1yGYe", 830 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 831 | "tags": [] 832 | }, 833 | { 834 | "__type__": "Note", 835 | "data": "", 836 | "fields": [ 837 | "What happens to the working directory when you switch branches?", 838 | "The files are updated to reflect the last commit of the branch. If it cannot be updated cleanly, git will not let you switch." 839 | ], 840 | "flags": 0, 841 | "guid": "uZYKi_w!c;", 842 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 843 | "tags": [] 844 | }, 845 | { 846 | "__type__": "Note", 847 | "data": "", 848 | "fields": [ 849 | "Why is a git branch cheap?", 850 | "A branch is a simple file that contains the 40 character SHA-1 checksum of the commit it points to." 851 | ], 852 | "flags": 0, 853 | "guid": "i}td:;X-$8", 854 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 855 | "tags": [] 856 | }, 857 | { 858 | "__type__": "Note", 859 | "data": "", 860 | "fields": [ 861 | "What is a \"fast-forward\" merge?", 862 | "When you try to merge a commit that can be reached by following the first commit's history, git will simply move the pointer forward because there is no divergent work to merge together. This is known as a \"fast-forward\" merge." 863 | ], 864 | "flags": 0, 865 | "guid": "rVbh7YpG/J", 866 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 867 | "tags": [] 868 | }, 869 | { 870 | "__type__": "Note", 871 | "data": "", 872 | "fields": [ 873 | "What is a merge commit?", 874 | "When two divergent branches are merged, git creates a new snapshot and a new commit that points to it. A merge commit has more than one parent." 875 | ], 876 | "flags": 0, 877 | "guid": "I_KQ5^#C&9", 878 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 879 | "tags": [] 880 | }, 881 | { 882 | "__type__": "Note", 883 | "data": "", 884 | "fields": [ 885 | "How is git different in dealing with the merge base when merging branches?", 886 | "Git determines the best common ancestor to use for its merge base, which is a lot simpler than many other VCSes." 887 | ], 888 | "flags": 0, 889 | "guid": "tgr3Vb|<^/", 890 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 891 | "tags": [] 892 | }, 893 | { 894 | "__type__": "Note", 895 | "data": "", 896 | "fields": [ 897 | "What does the leading * character mean in the output of git branch?", 898 | "It indicates the branch you have currently checked out (that HEAD points to)." 899 | ], 900 | "flags": 0, 901 | "guid": "B@=#&gvD8$", 902 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 903 | "tags": [] 904 | }, 905 | { 906 | "__type__": "Note", 907 | "data": "", 908 | "fields": [ 909 | "What is the name used for a branching workflow where sets of commits graduate to a more stable silo when they're fully tested?
", 910 | "progressive-stability branching
" 911 | ], 912 | "flags": 0, 913 | "guid": "z/@Lr]Q(#S", 914 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 915 | "tags": [] 916 | }, 917 | { 918 | "__type__": "Note", 919 | "data": "", 920 | "fields": [ 921 | "What is the name for a short-lived branch for a single particular feature or related work?
", 922 | "topic branch
" 923 | ], 924 | "flags": 0, 925 | "guid": "i!X._o?lw1", 926 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 927 | "tags": [] 928 | }, 929 | { 930 | "__type__": "Note", 931 | "data": "", 932 | "fields": [ 933 | "What are remote branches?
", 934 | "Pointers to the state of branches in remote repositories. They are local branches that you cannot move.
" 935 | ], 936 | "flags": 0, 937 | "guid": "G#8JF}nb2h", 938 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 939 | "tags": [] 940 | }, 941 | { 942 | "__type__": "Note", 943 | "data": "", 944 | "fields": [ 945 | "When are remote branch pointers updated?
", 946 | "They are automatically moved when you do any network communication.
" 947 | ], 948 | "flags": 0, 949 | "guid": "J6*@RPtUh1", 950 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 951 | "tags": [] 952 | }, 953 | { 954 | "__type__": "Note", 955 | "data": "", 956 | "fields": [ 957 | "When you fetch a remote branch, will it automatically set up a local branch with the same name?", 958 | "No. You must either merge it or create your own branch from it." 959 | ], 960 | "flags": 0, 961 | "guid": "Q5})51ApH+", 962 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 963 | "tags": [] 964 | }, 965 | { 966 | "__type__": "Note", 967 | "data": "", 968 | "fields": [ 969 | "What is the shorthand for referencing the tracking remote and branch?", 970 | "@{u} or @{upstream}" 971 | ], 972 | "flags": 0, 973 | "guid": "tK3qT-!z5k", 974 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 975 | "tags": [] 976 | }, 977 | { 978 | "__type__": "Note", 979 | "data": "", 980 | "fields": [ 981 | "How does rebasing affect the commit history differently than a merge?", 982 | "A rebase will make the commit history look linear/clean rather than a bunch of branch merges. This is often done to make sure your commits apply cleanly to a remote branch." 983 | ], 984 | "flags": 0, 985 | "guid": "zcp*jH9a&8", 986 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 987 | "tags": [] 988 | }, 989 | { 990 | "__type__": "Note", 991 | "data": "", 992 | "fields": [ 993 | "What one tip should you follow to avoid a drawback of rebasing?", 994 | "Do not rebase commits that exist outside of your repository." 995 | ], 996 | "flags": 0, 997 | "guid": "ATWa!RS=Z&", 998 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 999 | "tags": [] 1000 | }, 1001 | { 1002 | "__type__": "Note", 1003 | "data": "", 1004 | "fields": [ 1005 | "What is a good general rule for deciding when to rebase or to merge?", 1006 | "Rebase local changes you haven't shared yet in order to clean up, but never rebase anything you pushed somewhere." 1007 | ], 1008 | "flags": 0, 1009 | "guid": "xN+rNGwU1e", 1010 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 1011 | "tags": [] 1012 | }, 1013 | { 1014 | "__type__": "Note", 1015 | "data": "", 1016 | "fields": [ 1017 | "What is a \"bare repository\"?", 1018 | "A repository that doesn't contain a working directory" 1019 | ], 1020 | "flags": 0, 1021 | "guid": "uN=LqKN.,h", 1022 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 1023 | "tags": [] 1024 | } 1025 | ] 1026 | }, 1027 | { 1028 | "__type__": "Deck", 1029 | "children": [], 1030 | "crowdanki_uuid": "a6a24430-6d5b-11e6-adf3-8c705a50cbf0", 1031 | "deck_config_uuid": "a69dd698-6d5b-11e6-adf3-8c705a50cbf0", 1032 | "desc": "Please see the shared deck page for more info.", 1033 | "dyn": 0, 1034 | "extendNew": 1, 1035 | "extendRev": 50, 1036 | "media_files": [], 1037 | "mid": "1467568254113", 1038 | "name": "Commands", 1039 | "notes": [ 1040 | { 1041 | "__type__": "Note", 1042 | "data": "", 1043 | "fields": [ 1044 | "Which command will initialize a new, empty repository in the current working directory?", 1045 | "
git init
", 1046 | "", 1047 | "" 1048 | ], 1049 | "flags": 0, 1050 | "guid": "vd<-:IY:nA", 1051 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1052 | "tags": [] 1053 | }, 1054 | { 1055 | "__type__": "Note", 1056 | "data": "", 1057 | "fields": [ 1058 | "What command is used to configure the local user's email (\"email\"), that are used when committing to Git repositories?", 1059 | "
git config --global user.email \"email\"
", 1060 | "", 1061 | "" 1062 | ], 1063 | "flags": 0, 1064 | "guid": "Oy*>$5ZF=,", 1065 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1066 | "tags": [ 1067 | "git", 1068 | "shell" 1069 | ] 1070 | }, 1071 | { 1072 | "__type__": "Note", 1073 | "data": "", 1074 | "fields": [ 1075 | "What does this command do: git add .  ", 1076 | "It adds everything inside the current working directory to the index." 1077 | ], 1078 | "flags": 0, 1079 | "guid": "bFER[=-<|E", 1080 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 1081 | "tags": [] 1082 | }, 1083 | { 1084 | "__type__": "Note", 1085 | "data": "", 1086 | "fields": [ 1087 | "Which commands are needed to add all .js files to the local Git repository?", 1088 | "
git add *.js
", 1089 | "", 1090 | "" 1091 | ], 1092 | "flags": 0, 1093 | "guid": "ybvT<[dy(K", 1094 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1095 | "tags": [] 1096 | }, 1097 | { 1098 | "__type__": "Note", 1099 | "data": "", 1100 | "fields": [ 1101 | "Which command will commit to the local repository, including a commit message (\"message\")?", 1102 | "
git commit -m \"message\"
", 1103 | "", 1104 | "" 1105 | ], 1106 | "flags": 0, 1107 | "guid": "db&Hk]Np30", 1108 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1109 | "tags": [] 1110 | }, 1111 | { 1112 | "__type__": "Note", 1113 | "data": "", 1114 | "fields": [ 1115 | "Which command prints  the current state of your code/repository?", 1116 | "
git status
", 1117 | "", 1118 | "" 1119 | ], 1120 | "flags": 0, 1121 | "guid": "yl]3.#F=wd", 1122 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1123 | "tags": [] 1124 | }, 1125 | { 1126 | "__type__": "Note", 1127 | "data": "", 1128 | "fields": [ 1129 | "Which Git command is used to list the existing branches?", 1130 | "
git branch
", 1131 | "", 1132 | "Ommitting all options to the \"git branch\" command, will list the existing branches." 1133 | ], 1134 | "flags": 0, 1135 | "guid": "xx=?AKe[yR", 1136 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1137 | "tags": [] 1138 | }, 1139 | { 1140 | "__type__": "Note", 1141 | "data": "", 1142 | "fields": [ 1143 | "Which command creates a new branch (\"branchname\")?", 1144 | "
git branch branchname
", 1145 | "", 1146 | "" 1147 | ], 1148 | "flags": 0, 1149 | "guid": "P~gJ-(ZRpb", 1150 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1151 | "tags": [] 1152 | }, 1153 | { 1154 | "__type__": "Note", 1155 | "data": "", 1156 | "fields": [ 1157 | "Which command will switch to the branch \"myotherbranch\"?", 1158 | "
git checkout myotherbranch
", 1159 | "", 1160 | "" 1161 | ], 1162 | "flags": 0, 1163 | "guid": "A;K+h*%{g+", 1164 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1165 | "tags": [] 1166 | }, 1167 | { 1168 | "__type__": "Note", 1169 | "data": "", 1170 | "fields": [ 1171 | "What commands will join everything from the branch \"bigIdea\" to be part of the \"master\" branch?", 1172 | "
git checkout master
\n
git merge bigIdea
" 1173 | ], 1174 | "flags": 0, 1175 | "guid": "xj?aKvn]u;", 1176 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 1177 | "tags": [] 1178 | }, 1179 | { 1180 | "__type__": "Note", 1181 | "data": "", 1182 | "fields": [ 1183 | "Which command will delete (even) an unmerged branch (\"branchname\")?", 1184 | "git branch -D branchname", 1185 | "", 1186 | "" 1187 | ], 1188 | "flags": 0, 1189 | "guid": "cy@|.4O)Rb", 1190 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1191 | "tags": [] 1192 | }, 1193 | { 1194 | "__type__": "Note", 1195 | "data": "", 1196 | "fields": [ 1197 | "Which command displays the existing global Git settings?
", 1198 | "
git config --list
", 1199 | "", 1200 | "" 1201 | ], 1202 | "flags": 0, 1203 | "guid": "gCNrkn8>}D", 1204 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1205 | "tags": [] 1206 | }, 1207 | { 1208 | "__type__": "Note", 1209 | "data": "", 1210 | "fields": [ 1211 | "Which command shows commit logs (list of all commits, starting with newest)?
", 1212 | "
git log
", 1213 | "
For each commit the following info would be displayed
1. SHA-1 identifier
2. Author and Email
3. Date + time of the commit
4. Commit message header", 1214 | "" 1215 | ], 1216 | "flags": 0, 1217 | "guid": "F.SR4G,Gfi", 1218 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1219 | "tags": [] 1220 | }, 1221 | { 1222 | "__type__": "Note", 1223 | "data": "", 1224 | "fields": [ 1225 | "Which command displays all changes to tracked files since the last commit?
", 1226 | "
git diff
", 1227 | "", 1228 | "" 1229 | ], 1230 | "flags": 0, 1231 | "guid": "gz>^p#~9is", 1232 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1233 | "tags": [] 1234 | }, 1235 | { 1236 | "__type__": "Note", 1237 | "data": "", 1238 | "fields": [ 1239 | "Which command displays the changes in a specific commit (\"commitid\")?", 1240 | "
git show commitid
", 1241 | "", 1242 | "" 1243 | ], 1244 | "flags": 0, 1245 | "guid": "Km<`;Sy=)R", 1246 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1247 | "tags": [] 1248 | }, 1249 | { 1250 | "__type__": "Note", 1251 | "data": "", 1252 | "fields": [ 1253 | "Which command displays the change history of a specific file (\"filename\")?", 1254 | "
git log filename
", 1255 | "", 1256 | "" 1257 | ], 1258 | "flags": 0, 1259 | "guid": "c|}&67Vqgit blame filename", 1269 | "", 1270 | "" 1271 | ], 1272 | "flags": 0, 1273 | "guid": "zhQu]56^%W", 1274 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1275 | "tags": [] 1276 | }, 1277 | { 1278 | "__type__": "Note", 1279 | "data": "", 1280 | "fields": [ 1281 | "Which command deletes a file (\"filename\") from the working directory and at the same time marks it for the next commit?
", 1282 | "
git rm filename
", 1283 | "", 1284 | "" 1285 | ], 1286 | "flags": 0, 1287 | "guid": "jPCDaOPH-e", 1288 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1289 | "tags": [] 1290 | }, 1291 | { 1292 | "__type__": "Note", 1293 | "data": "", 1294 | "fields": [ 1295 | "Which command displays the existing defined remote repositories?
", 1296 | "
git remote
", 1297 | "", 1298 | "" 1299 | ], 1300 | "flags": 0, 1301 | "guid": "BW0mPtV2np", 1302 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1303 | "tags": [] 1304 | }, 1305 | { 1306 | "__type__": "Note", 1307 | "data": "", 1308 | "fields": [ 1309 | "Which command cleans untracked changes in the working directory?", 1310 | "
git clean -f
", 1311 | "optional:
-d to remove untracked directories
-x remove also \"ignored files\"
", 1312 | "" 1313 | ], 1314 | "flags": 0, 1315 | "guid": "tLncJ/l5g8", 1316 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1317 | "tags": [] 1318 | }, 1319 | { 1320 | "__type__": "Note", 1321 | "data": "", 1322 | "fields": [ 1323 | "How can you revert a deleted or changed file (\"filename\") that has not yet been added to the index?
", 1324 | "git checkout filename", 1325 | "Add -- after checkout to avoid naming conflicts if you have tag or branch with the same name", 1326 | "" 1327 | ], 1328 | "flags": 0, 1329 | "guid": "fB~P#a9Rr9", 1330 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1331 | "tags": [] 1332 | }, 1333 | { 1334 | "__type__": "Note", 1335 | "data": "", 1336 | "fields": [ 1337 | "How can you checkout older revisions of your source code (revision \"commitid\")?
", 1338 | "git checkout commitid", 1339 | "Via checking out specific commit id", 1340 | "" 1341 | ], 1342 | "flags": 0, 1343 | "guid": "mO83Khi,Bp", 1344 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1345 | "tags": [] 1346 | }, 1347 | { 1348 | "__type__": "Note", 1349 | "data": "", 1350 | "fields": [ 1351 | "Which command removes an added file (\"filename\") from the index again?
", 1352 | "
git reset filename
", 1353 | "", 1354 | "" 1355 | ], 1356 | "flags": 0, 1357 | "guid": "r9_$:6`{&]", 1358 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1359 | "tags": [] 1360 | }, 1361 | { 1362 | "__type__": "Note", 1363 | "data": "", 1364 | "fields": [ 1365 | "How can all changes of a commit (\"commitid\") be reverted and a new commit be recorded, which documents that the other commit was reverted?
", 1366 | "
git revert commitid
", 1367 | "", 1368 | "" 1369 | ], 1370 | "flags": 0, 1371 | "guid": "IkdEc`A5@C", 1372 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1373 | "tags": [] 1374 | }, 1375 | { 1376 | "__type__": "Note", 1377 | "data": "", 1378 | "fields": [ 1379 | "Which command lists the available tags?
", 1380 | "
git tag
", 1381 | "", 1382 | "" 1383 | ], 1384 | "flags": 0, 1385 | "guid": "C%6YFoMT|@", 1386 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1387 | "tags": [] 1388 | }, 1389 | { 1390 | "__type__": "Note", 1391 | "data": "", 1392 | "fields": [ 1393 | "Which command creates a new tag (\"tagname\") with a description (description)?", 1394 | "
git tag tagname -m 'description'
", 1395 | "", 1396 | "" 1397 | ], 1398 | "flags": 0, 1399 | "guid": "QXr(!z{!JN", 1400 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1401 | "tags": [] 1402 | }, 1403 | { 1404 | "__type__": "Note", 1405 | "data": "", 1406 | "fields": [ 1407 | "Which command will check out a specific tag (\"tagname\")?", 1408 | "
git checkout tagname
", 1409 | "", 1410 | "" 1411 | ], 1412 | "flags": 0, 1413 | "guid": "px*Wlists all branches, including remote branches?", 1422 | "
git branch -a
", 1423 | "", 1424 | "" 1425 | ], 1426 | "flags": 0, 1427 | "guid": "Lh{-~`~T,3", 1428 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1429 | "tags": [] 1430 | }, 1431 | { 1432 | "__type__": "Note", 1433 | "data": "", 1434 | "fields": [ 1435 | "Which command creates a new branch (branchname) and switches to it?", 1436 | "git checkout -b branchname", 1437 | "", 1438 | "" 1439 | ], 1440 | "flags": 0, 1441 | "guid": "M|AX8qt~>O", 1442 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1443 | "tags": [] 1444 | }, 1445 | { 1446 | "__type__": "Note", 1447 | "data": "", 1448 | "fields": [ 1449 | "Which command would delete the local \"testing\" branch (if it is merged)?
", 1450 | "
git branch -d testing
", 1451 | "", 1452 | "" 1453 | ], 1454 | "flags": 0, 1455 | "guid": "E$0ONs0VO;", 1456 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1457 | "tags": [] 1458 | }, 1459 | { 1460 | "__type__": "Note", 1461 | "data": "", 1462 | "fields": [ 1463 | "Which command merges differences of the \"testing\" branch into the current active branch?
", 1464 | "
git merge testing
", 1465 | "", 1466 | "" 1467 | ], 1468 | "flags": 0, 1469 | "guid": "BX2UBkW5(_", 1470 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1471 | "tags": [] 1472 | }, 1473 | { 1474 | "__type__": "Note", 1475 | "data": "", 1476 | "fields": [ 1477 | "Which default Git tool exists for resolving conflicts, which command starts it?
", 1478 | "git mergetool", 1479 | "", 1480 | "" 1481 | ], 1482 | "flags": 0, 1483 | "guid": "wV]w?R>lcp", 1484 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1485 | "tags": [] 1486 | }, 1487 | { 1488 | "__type__": "Note", 1489 | "data": "", 1490 | "fields": [ 1491 | "Which command would start interactive rebase of the last seven commits?", 1492 | "
git rebase -i HEAD~7
", 1493 | "", 1494 | "More info on interactive mode here: https://git-scm.com/docs/git-rebase" 1495 | ], 1496 | "flags": 0, 1497 | "guid": "rYX3zdLiLv", 1498 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1499 | "tags": [] 1500 | }, 1501 | { 1502 | "__type__": "Note", 1503 | "data": "", 1504 | "fields": [ 1505 | "Which command displays which commit deleted a specific file (\"filename\")?
", 1506 | "
git log -- filename
", 1507 | "", 1508 | "" 1509 | ], 1510 | "flags": 0, 1511 | "guid": "qT8-CD>aCh", 1512 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1513 | "tags": [] 1514 | }, 1515 | { 1516 | "__type__": "Note", 1517 | "data": "", 1518 | "fields": [ 1519 | "What is the -- option in git log used for?
", 1520 | "To see the commit history for a file, even if the file has been deleted.
" 1521 | ], 1522 | "flags": 0, 1523 | "guid": "en>uh_WPEG", 1524 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 1525 | "tags": [] 1526 | }, 1527 | { 1528 | "__type__": "Note", 1529 | "data": "", 1530 | "fields": [ 1531 | "Which command will define an alias \"add-commit\", which
combines
git add . -A
and
git commit?", 1532 | "
git config --global alias.add-commit '!git add . -A && git commit'
", 1533 | "! is to specify that it's an external command", 1534 | "" 1535 | ], 1536 | "flags": 0, 1537 | "guid": "v4!4YvMOyH", 1538 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1539 | "tags": [] 1540 | }, 1541 | { 1542 | "__type__": "Note", 1543 | "data": "", 1544 | "fields": [ 1545 | "What does the command do: git reset --soft HEAD~", 1546 | "Undo the last commit. The affected files will be back on stage again." 1547 | ], 1548 | "flags": 0, 1549 | "guid": "Bb9(y,?O!N", 1550 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 1551 | "tags": [] 1552 | }, 1553 | { 1554 | "__type__": "Note", 1555 | "data": "", 1556 | "fields": [ 1557 | "What does git reset --hard HEAD~ do? (instead of HEAD~ it could be also a commit SHA-1 or another reference)", 1558 | "Undo the last commit, unstage files AND undo any changes in the working directory. (Not tracked files won't be affected)" 1559 | ], 1560 | "flags": 0, 1561 | "guid": "e?#@Ae7yYi", 1562 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 1563 | "tags": [] 1564 | }, 1565 | { 1566 | "__type__": "Note", 1567 | "data": "", 1568 | "fields": [ 1569 | "Which parameter allows you to stage an ignored file?", 1570 | "
--force
", 1571 | "", 1572 | "" 1573 | ], 1574 | "flags": 0, 1575 | "guid": "t#C`2kFJh%", 1576 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1577 | "tags": [] 1578 | }, 1579 | { 1580 | "__type__": "Note", 1581 | "data": "", 1582 | "fields": [ 1583 | "Which Git command newly stages a specific file (\"filename\")?", 1584 | "
git add filename
", 1585 | "", 1586 | "" 1587 | ], 1588 | "flags": 0, 1589 | "guid": "F9hBmh|l1!", 1590 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1591 | "tags": [] 1592 | }, 1593 | { 1594 | "__type__": "Note", 1595 | "data": "", 1596 | "fields": [ 1597 | "Which command will undo the checking-in of an unwanted change in a file \"filename\" (remove the respective file from the index), but keep the changes in the filesystem?", 1598 | "
git reset filename
", 1599 | "", 1600 | "" 1601 | ], 1602 | "flags": 0, 1603 | "guid": "K&{Me3,SpN", 1604 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1605 | "tags": [] 1606 | }, 1607 | { 1608 | "__type__": "Note", 1609 | "data": "", 1610 | "fields": [ 1611 | "What is the difference between:
git checkout -f
and
git reset --hard HEAD
?", 1612 | "None, with these parameters they do exactly the same." 1613 | ], 1614 | "flags": 0, 1615 | "guid": "v*,Ks", 1616 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 1617 | "tags": [] 1618 | }, 1619 | { 1620 | "__type__": "Note", 1621 | "data": "", 1622 | "fields": [ 1623 | "Remove main.txt from staging but keep in working (untrack file, after this and commit file would be remove from repo)", 1624 | "git rm --cached main.txt", 1625 | "", 1626 | "" 1627 | ], 1628 | "flags": 0, 1629 | "guid": "Q+7&uzQT|w", 1630 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1631 | "tags": [] 1632 | }, 1633 | { 1634 | "__type__": "Note", 1635 | "data": "", 1636 | "fields": [ 1637 | "Which command / parameter changes the message of the last commit? (for \"newmessage\")
", 1638 | "git commit --amend -m \"newmessage\"
", 1639 | "", 1640 | "" 1641 | ], 1642 | "flags": 0, 1643 | "guid": "PI~KTfs,vb", 1644 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1645 | "tags": [] 1646 | }, 1647 | { 1648 | "__type__": "Note", 1649 | "data": "", 1650 | "fields": [ 1651 | "Clone an existing repository (address: \"url\")", 1652 | "git clone url", 1653 | "", 1654 | "" 1655 | ], 1656 | "flags": 0, 1657 | "guid": "G82n[7RC-w", 1658 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1659 | "tags": [] 1660 | }, 1661 | { 1662 | "__type__": "Note", 1663 | "data": "", 1664 | "fields": [ 1665 | "Create a new local repository", 1666 | "git init", 1667 | "", 1668 | "" 1669 | ], 1670 | "flags": 0, 1671 | "guid": "q@#s*s3u]g", 1672 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1673 | "tags": [] 1674 | }, 1675 | { 1676 | "__type__": "Note", 1677 | "data": "", 1678 | "fields": [ 1679 | "Add some (allows you interactively to choose which) changes in file to the next commit", 1680 | "git add -p file", 1681 | "", 1682 | "" 1683 | ], 1684 | "flags": 0, 1685 | "guid": "PMP7kE]98_", 1686 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1687 | "tags": [] 1688 | }, 1689 | { 1690 | "__type__": "Note", 1691 | "data": "", 1692 | "fields": [ 1693 | "Commit all local changes in tracked files", 1694 | "git commit -a", 1695 | "", 1696 | "" 1697 | ], 1698 | "flags": 0, 1699 | "guid": "u.R(/o`lN5", 1700 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1701 | "tags": [] 1702 | }, 1703 | { 1704 | "__type__": "Note", 1705 | "data": "", 1706 | "fields": [ 1707 | "Commit previously staged changes", 1708 | "git commit", 1709 | "", 1710 | "" 1711 | ], 1712 | "flags": 0, 1713 | "guid": "CD?#JCMZQT", 1714 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1715 | "tags": [] 1716 | }, 1717 | { 1718 | "__type__": "Note", 1719 | "data": "", 1720 | "fields": [ 1721 | "Change the last commit [only before pushing]", 1722 | "git commit --amend", 1723 | "", 1724 | "" 1725 | ], 1726 | "flags": 0, 1727 | "guid": "AuqfF!TJF|", 1728 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1729 | "tags": [] 1730 | }, 1731 | { 1732 | "__type__": "Note", 1733 | "data": "", 1734 | "fields": [ 1735 | "Show changes over time (diffs) for a specific file (\"filename\")", 1736 | "git log -p filename", 1737 | "", 1738 | "" 1739 | ], 1740 | "flags": 0, 1741 | "guid": "LXatc~.8(T", 1742 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1743 | "tags": [] 1744 | }, 1745 | { 1746 | "__type__": "Note", 1747 | "data": "", 1748 | "fields": [ 1749 | "Switch HEAD to branch", 1750 | "git checkout branch", 1751 | "", 1752 | "" 1753 | ], 1754 | "flags": 0, 1755 | "guid": "oQvc(-wSfJ", 1756 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1757 | "tags": [] 1758 | }, 1759 | { 1760 | "__type__": "Note", 1761 | "data": "", 1762 | "fields": [ 1763 | "Create a new branch (name \"nbranch\") based on current HEAD", 1764 | "git branch nbranch", 1765 | "", 1766 | "" 1767 | ], 1768 | "flags": 0, 1769 | "guid": "D@AO#)N}^n", 1770 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1771 | "tags": [] 1772 | }, 1773 | { 1774 | "__type__": "Note", 1775 | "data": "", 1776 | "fields": [ 1777 | "Create a new tracking branch (\"tbranch\") based on a remote branch (\"rbranch\")", 1778 | "git branch --track tbranch rbranch", 1779 | "", 1780 | "" 1781 | ], 1782 | "flags": 0, 1783 | "guid": "iSDwh!LidQ", 1784 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1785 | "tags": [] 1786 | }, 1787 | { 1788 | "__type__": "Note", 1789 | "data": "", 1790 | "fields": [ 1791 | "Delete a local branch (\"branch\")", 1792 | "git branch -d branch", 1793 | "", 1794 | "" 1795 | ], 1796 | "flags": 0, 1797 | "guid": "kFL]Z[c?WW", 1798 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1799 | "tags": [] 1800 | }, 1801 | { 1802 | "__type__": "Note", 1803 | "data": "", 1804 | "fields": [ 1805 | "Mark the current commit with a tag (\"tagname\")", 1806 | "git tag tagname", 1807 | "", 1808 | "" 1809 | ], 1810 | "flags": 0, 1811 | "guid": "s!ZB.hS(-G", 1812 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1813 | "tags": [] 1814 | }, 1815 | { 1816 | "__type__": "Note", 1817 | "data": "", 1818 | "fields": [ 1819 | "Show information about a remote (\"origin\")", 1820 | "git remote show origin", 1821 | "", 1822 | "" 1823 | ], 1824 | "flags": 0, 1825 | "guid": "tF=*UV)5N=", 1826 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1827 | "tags": [] 1828 | }, 1829 | { 1830 | "__type__": "Note", 1831 | "data": "", 1832 | "fields": [ 1833 | "Add remote server 'url' with shortname 'myurl'", 1834 | "git remote add myurl url", 1835 | "", 1836 | "" 1837 | ], 1838 | "flags": 0, 1839 | "guid": "HoFoQWIJch", 1840 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1841 | "tags": [] 1842 | }, 1843 | { 1844 | "__type__": "Note", 1845 | "data": "", 1846 | "fields": [ 1847 | "Download all changes from remote (\"origin\") but don't integrate into HEAD", 1848 | "git fetch origin", 1849 | "", 1850 | "" 1851 | ], 1852 | "flags": 0, 1853 | "guid": "fANXqT[p/F", 1854 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1855 | "tags": [] 1856 | }, 1857 | { 1858 | "__type__": "Note", 1859 | "data": "", 1860 | "fields": [ 1861 | "Download changes from remote (\"origin\") branch \"branch\" and directly merge into HEAD", 1862 | "git pull origin branch", 1863 | "", 1864 | "" 1865 | ], 1866 | "flags": 0, 1867 | "guid": "u82$&koLO+", 1868 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1869 | "tags": [] 1870 | }, 1871 | { 1872 | "__type__": "Note", 1873 | "data": "", 1874 | "fields": [ 1875 | "Publish local changes (for a branch \"branch\") on a remote (\"origin\")", 1876 | "git push origin branch", 1877 | "", 1878 | "" 1879 | ], 1880 | "flags": 0, 1881 | "guid": "Ln4&)EH3[6", 1882 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1883 | "tags": [] 1884 | }, 1885 | { 1886 | "__type__": "Note", 1887 | "data": "", 1888 | "fields": [ 1889 | "Delete a \"branch\" on the remote (\"origin\") (old way)", 1890 | "git push origin :branch", 1891 | "", 1892 | "" 1893 | ], 1894 | "flags": 0, 1895 | "guid": "b:dG)*p%)g", 1896 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1897 | "tags": [] 1898 | }, 1899 | { 1900 | "__type__": "Note", 1901 | "data": "", 1902 | "fields": [ 1903 | "Publish your tags", 1904 | "git push --tags", 1905 | "", 1906 | "" 1907 | ], 1908 | "flags": 0, 1909 | "guid": "lapc;rQKP$", 1910 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1911 | "tags": [] 1912 | }, 1913 | { 1914 | "__type__": "Note", 1915 | "data": "", 1916 | "fields": [ 1917 | "Merge branch into your current HEAD", 1918 | "git merge branch", 1919 | "", 1920 | "" 1921 | ], 1922 | "flags": 0, 1923 | "guid": "AKq80IBb}P", 1924 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1925 | "tags": [] 1926 | }, 1927 | { 1928 | "__type__": "Note", 1929 | "data": "", 1930 | "fields": [ 1931 | "Rebase your current HEAD onto branch", 1932 | "git rebase branch", 1933 | "", 1934 | "" 1935 | ], 1936 | "flags": 0, 1937 | "guid": "J<:a=e?`oZ", 1938 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1939 | "tags": [] 1940 | }, 1941 | { 1942 | "__type__": "Note", 1943 | "data": "", 1944 | "fields": [ 1945 | "Abort a rebase", 1946 | "git rebase --abort", 1947 | "", 1948 | "" 1949 | ], 1950 | "flags": 0, 1951 | "guid": "Q8k(Cko^;c", 1952 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1953 | "tags": [] 1954 | }, 1955 | { 1956 | "__type__": "Note", 1957 | "data": "", 1958 | "fields": [ 1959 | "Continue a rebase after resolving conflicts", 1960 | "git rebase --continue", 1961 | "", 1962 | "" 1963 | ], 1964 | "flags": 0, 1965 | "guid": "P}-RgapC#;", 1966 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1967 | "tags": [] 1968 | }, 1969 | { 1970 | "__type__": "Note", 1971 | "data": "", 1972 | "fields": [ 1973 | "Use your configured merge tool to solve conflicts", 1974 | "git mergetool", 1975 | "", 1976 | "" 1977 | ], 1978 | "flags": 0, 1979 | "guid": "ktUT0Y8n@/", 1980 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 1981 | "tags": [] 1982 | }, 1983 | { 1984 | "__type__": "Note", 1985 | "data": "", 1986 | "fields": [ 1987 | "Use your editor to manually solve conflicts during merge/rebase and after resolving mark file as resolved with:", 1988 | "git add resolved-file or
git rm resolved-file
" 1989 | ], 1990 | "flags": 0, 1991 | "guid": "x:&=qXfilename", 2017 | "", 2018 | "" 2019 | ], 2020 | "flags": 0, 2021 | "guid": "AiXZD7qnCt", 2022 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2023 | "tags": [] 2024 | }, 2025 | { 2026 | "__type__": "Note", 2027 | "data": "", 2028 | "fields": [ 2029 | "Reset your HEAD pointer to some previous commit (and discard all changes since then)", 2030 | "git reset --hard commit", 2031 | "", 2032 | "" 2033 | ], 2034 | "flags": 0, 2035 | "guid": "i[4p_Cw|hU", 2036 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2037 | "tags": [] 2038 | }, 2039 | { 2040 | "__type__": "Note", 2041 | "data": "", 2042 | "fields": [ 2043 | "Reset your HEAD pointer to some previous commit, and preserve all changes as unstaged changes", 2044 | "git reset commit", 2045 | "", 2046 | "" 2047 | ], 2048 | "flags": 0, 2049 | "guid": "f.*![R]E|?", 2050 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2051 | "tags": [] 2052 | }, 2053 | { 2054 | "__type__": "Note", 2055 | "data": "", 2056 | "fields": [ 2057 | "Reset your HEAD pointer to some previous commit (\"commit\") and preserve uncommited local changes", 2058 | "git reset --keep commit", 2059 | "If a file that is different between <commit> and HEAD has local changes, reset is aborted.", 2060 | "" 2061 | ], 2062 | "flags": 0, 2063 | "guid": "R|LmdnJ,y", 2064 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2065 | "tags": [] 2066 | }, 2067 | { 2068 | "__type__": "Note", 2069 | "data": "", 2070 | "fields": [ 2071 | "What tool is used to get and set configuration variables that control how git looks and operates?", 2072 | "git config", 2073 | "", 2074 | "" 2075 | ], 2076 | "flags": 0, 2077 | "guid": "fxZQIT(,(b", 2078 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2079 | "tags": [] 2080 | }, 2081 | { 2082 | "__type__": "Note", 2083 | "data": "", 2084 | "fields": [ 2085 | "What .gitignore pattern would you use to ignore all .txt files in the doc folder?", 2086 | "doc/**/*.txt", 2087 | "", 2088 | "https://git-scm.com/docs/gitignore" 2089 | ], 2090 | "flags": 0, 2091 | "guid": "EADNWO/y%=", 2092 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2093 | "tags": [] 2094 | }, 2095 | { 2096 | "__type__": "Note", 2097 | "data": "", 2098 | "fields": [ 2099 | "How can you skip the staging area for modified, tracked files when doing a commit?", 2100 | "git commit -a", 2101 | "", 2102 | "" 2103 | ], 2104 | "flags": 0, 2105 | "guid": "v].?TQ-:3w", 2106 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2107 | "tags": [] 2108 | }, 2109 | { 2110 | "__type__": "Note", 2111 | "data": "", 2112 | "fields": [ 2113 | "How do you delete a file that has been modified and already added to the staging area?", 2114 | "git rm -f file", 2115 | "", 2116 | "" 2117 | ], 2118 | "flags": 0, 2119 | "guid": "t-q}2tG:=X", 2120 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2121 | "tags": [] 2122 | }, 2123 | { 2124 | "__type__": "Note", 2125 | "data": "", 2126 | "fields": [ 2127 | "How do you rename or move a file in git (\"src\" to \"target\")?", 2128 | "git mv src target", 2129 | "", 2130 | "" 2131 | ], 2132 | "flags": 0, 2133 | "guid": "hwwyi_%Pd8", 2134 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2135 | "tags": [] 2136 | }, 2137 | { 2138 | "__type__": "Note", 2139 | "data": "", 2140 | "fields": [ 2141 | "What are some of the options to view the commit log history in different formats?", 2142 | "--pretty=[oneline | short | full | fuller]
--pretty=format:\"...\"
" 2143 | ], 2144 | "flags": 0, 2145 | "guid": "mqXLAB~pFz", 2146 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 2147 | "tags": [] 2148 | }, 2149 | { 2150 | "__type__": "Note", 2151 | "data": "", 2152 | "fields": [ 2153 | "How do you view the history for author jdoe with keyword potato in the commit message made in the last two weeks that added or removed a reference to the function mashThePotato that were not merges?", 2154 | "git log --author jdoe --grep potato --all-match -SmashThePotato --since=2.weeks --no-merges" 2155 | ], 2156 | "flags": 0, 2157 | "guid": "eh}B.z/n^;", 2158 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 2159 | "tags": [] 2160 | }, 2161 | { 2162 | "__type__": "Note", 2163 | "data": "", 2164 | "fields": [ 2165 | "Why is git reset considered safe without \"--hard\" option?", 2166 | "It only affects your staging area" 2167 | ], 2168 | "flags": 0, 2169 | "guid": "JC%^;+L+{p", 2170 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 2171 | "tags": [] 2172 | }, 2173 | { 2174 | "__type__": "Note", 2175 | "data": "", 2176 | "fields": [ 2177 | "How do you tag revision 0123abc with the name v1.0?", 2178 | "git tag v1.0 0123abc", 2179 | "", 2180 | "" 2181 | ], 2182 | "flags": 0, 2183 | "guid": "wi-I)r_kC{", 2184 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2185 | "tags": [] 2186 | }, 2187 | { 2188 | "__type__": "Note", 2189 | "data": "", 2190 | "fields": [ 2191 | "What happens if you try to delete a branch with \"git branch -d <name>\" that has not yet been merged?", 2192 | "It will fail, and offer -D if you really want to lose your branch." 2193 | ], 2194 | "flags": 0, 2195 | "guid": "u)(3>G(PkD", 2196 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 2197 | "tags": [] 2198 | }, 2199 | { 2200 | "__type__": "Note", 2201 | "data": "", 2202 | "fields": [ 2203 | "If you want to use a different name than \"origin\" (eg \"norig\") for the remote when cloning a repository (\"repo\"), what parameter would you use?
", 2204 | "git clone -o norig repo
", 2205 | "", 2206 | "" 2207 | ], 2208 | "flags": 0, 2209 | "guid": "ce?E649%xX", 2210 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2211 | "tags": [] 2212 | }, 2213 | { 2214 | "__type__": "Note", 2215 | "data": "", 2216 | "fields": [ 2217 | "How would you share a local branch called \"badname\" as \"goodname\" on a remote called \"origin\"?
", 2218 | "git push origin badname:goodname
", 2219 | "", 2220 | "" 2221 | ], 2222 | "flags": 0, 2223 | "guid": "K7n]nn1&|k", 2224 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2225 | "tags": [] 2226 | }, 2227 | { 2228 | "__type__": "Note", 2229 | "data": "", 2230 | "fields": [ 2231 | "How would you set up a credential cache so that you don't have to keep typing your password for git push?", 2232 | "git config --global credential.helper cache", 2233 | "", 2234 | "" 2235 | ], 2236 | "flags": 0, 2237 | "guid": "p2[Clw3O~<", 2238 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2239 | "tags": [] 2240 | }, 2241 | { 2242 | "__type__": "Note", 2243 | "data": "", 2244 | "fields": [ 2245 | "If you have a local branch and you want it to use a remote branch (say origin/hotfix) as upstream, how would you set it?", 2246 | "git branch -u origin/hotfix", 2247 | "", 2248 | "" 2249 | ], 2250 | "flags": 0, 2251 | "guid": "m8|o{YV!nU", 2252 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2253 | "tags": [] 2254 | }, 2255 | { 2256 | "__type__": "Note", 2257 | "data": "", 2258 | "fields": [ 2259 | "How do you see what tracking branches you have set up?", 2260 | "git branch -vv", 2261 | "", 2262 | "" 2263 | ], 2264 | "flags": 0, 2265 | "guid": "LRM3~SSVl%", 2266 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2267 | "tags": [] 2268 | }, 2269 | { 2270 | "__type__": "Note", 2271 | "data": "", 2272 | "fields": [ 2273 | "How would you delete a remote branch (\"serverfix\") from the server (\"origin\")?", 2274 | "git push origin --delete serverfix", 2275 | "", 2276 | "" 2277 | ], 2278 | "flags": 0, 2279 | "guid": "Igy_c!s=?[", 2280 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2281 | "tags": [] 2282 | }, 2283 | { 2284 | "__type__": "Note", 2285 | "data": "", 2286 | "fields": [ 2287 | "How would you use rebase to apply master changes to branch b1, then apply b1 changes to master? The result being a linear history.", 2288 | "
# method: 1
git checkout b1
git rebase master
git checkout master
git merge b1

# method: 2
git rebase b1 master
git checkout master
git merge b1
" 2289 | ], 2290 | "flags": 0, 2291 | "guid": "BU,]d;k1vy", 2292 | "note_model_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 2293 | "tags": [] 2294 | }, 2295 | { 2296 | "__type__": "Note", 2297 | "data": "", 2298 | "fields": [ 2299 | "If you have changes on commits that no longer exist upstream (due to a remote rebase), how can you pull in those changes and avoid conflicts that would happen with git pull origin/master?", 2300 | "
git pull --rebase origin/master
", 2301 | "", 2302 | "" 2303 | ], 2304 | "flags": 0, 2305 | "guid": "r&Du}9yV]>", 2306 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2307 | "tags": [] 2308 | }, 2309 | { 2310 | "__type__": "Note", 2311 | "data": "", 2312 | "fields": [ 2313 | "What are limitations of the command that changes the message of the last commit (git commit --amend)?", 2314 | "It only works before the commit has been pushed to remote repo." 2315 | ], 2316 | "flags": 0, 2317 | "guid": "p}K},k:N*K", 2318 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 2319 | "tags": [ 2320 | "git", 2321 | "shell" 2322 | ] 2323 | }, 2324 | { 2325 | "__type__": "Note", 2326 | "data": "", 2327 | "fields": [ 2328 | "What command is used to configure the local user's name (\"Name\"), that are used when committing to Git repositories?", 2329 | "
git config --global user.name \"Name\"
", 2330 | "", 2331 | "" 2332 | ], 2333 | "flags": 0, 2334 | "guid": "tc$Es;:D1%", 2335 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2336 | "tags": [ 2337 | "git", 2338 | "shell" 2339 | ] 2340 | }, 2341 | { 2342 | "__type__": "Note", 2343 | "data": "", 2344 | "fields": [ 2345 | "Show what file would be delited with \"git clean\" (dry run)", 2346 | "git clean -n", 2347 | "(or --dry-run)", 2348 | "" 2349 | ], 2350 | "flags": 0, 2351 | "guid": "e%>lbo,!2:", 2352 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2353 | "tags": [ 2354 | "git", 2355 | "shell" 2356 | ] 2357 | }, 2358 | { 2359 | "__type__": "Note", 2360 | "data": "", 2361 | "fields": [ 2362 | "What option should you add to \"git clean\" in order to remove untracked directories", 2363 | "-d", 2364 | "", 2365 | "" 2366 | ], 2367 | "flags": 0, 2368 | "guid": "Q`Z}4EnZK~", 2369 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2370 | "tags": [ 2371 | "git", 2372 | "shell" 2373 | ] 2374 | }, 2375 | { 2376 | "__type__": "Note", 2377 | "data": "", 2378 | "fields": [ 2379 | "What option should you add to \"git clean\" in order to remove \"ignored\" files", 2380 | "-x", 2381 | "", 2382 | "" 2383 | ], 2384 | "flags": 0, 2385 | "guid": "dk~4Dx5y5N", 2386 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2387 | "tags": [ 2388 | "git", 2389 | "shell" 2390 | ] 2391 | }, 2392 | { 2393 | "__type__": "Note", 2394 | "data": "", 2395 | "fields": [ 2396 | "Which command will show the entire history (including renamesfor the file (\"filename\")?", 2397 | "
git log --follow -p filename
", 2398 | "", 2399 | "" 2400 | ], 2401 | "flags": 0, 2402 | "guid": "k`%2n:=CjO", 2403 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2404 | "tags": [ 2405 | "git", 2406 | "shell" 2407 | ] 2408 | }, 2409 | { 2410 | "__type__": "Note", 2411 | "data": "", 2412 | "fields": [ 2413 | "Create a stash with uncommitted changes (analogous to save uncommited changes, and do reset hard)", 2414 | "git stash", 2415 | "", 2416 | "" 2417 | ], 2418 | "flags": 0, 2419 | "guid": "ez-t2N[Xx1", 2420 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2421 | "tags": [ 2422 | "command", 2423 | "git", 2424 | "shell", 2425 | "stash" 2426 | ] 2427 | }, 2428 | { 2429 | "__type__": "Note", 2430 | "data": "", 2431 | "fields": [ 2432 | "Reapply the stashed changes and delete the stash from the list of stashes", 2433 | "git stash pop", 2434 | "", 2435 | "" 2436 | ], 2437 | "flags": 0, 2438 | "guid": "h?w8D]L^FH", 2439 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2440 | "tags": [ 2441 | "command", 2442 | "git", 2443 | "shell", 2444 | "stash" 2445 | ] 2446 | }, 2447 | { 2448 | "__type__": "Note", 2449 | "data": "", 2450 | "fields": [ 2451 | "Reapply the stashed changes without deleting stash from the list of stashes", 2452 | "git stash apply", 2453 | "", 2454 | "" 2455 | ], 2456 | "flags": 0, 2457 | "guid": "s]W5g${#u#", 2458 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2459 | "tags": [ 2460 | "command", 2461 | "git", 2462 | "shell", 2463 | "stash" 2464 | ] 2465 | }, 2466 | { 2467 | "__type__": "Note", 2468 | "data": "", 2469 | "fields": [ 2470 | "Show git stash stack (list of stashes)", 2471 | "git stash list", 2472 | "", 2473 | "" 2474 | ], 2475 | "flags": 0, 2476 | "guid": "Pd,w:x7/_-", 2477 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2478 | "tags": [ 2479 | "command", 2480 | "git", 2481 | "shell", 2482 | "stash" 2483 | ] 2484 | }, 2485 | { 2486 | "__type__": "Note", 2487 | "data": "", 2488 | "fields": [ 2489 | "Show branches already merged into current branch", 2490 | "git branch --merged", 2491 | "", 2492 | "" 2493 | ], 2494 | "flags": 0, 2495 | "guid": "r6fVPW{|To", 2496 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2497 | "tags": [ 2498 | "command", 2499 | "git", 2500 | "shell" 2501 | ] 2502 | }, 2503 | { 2504 | "__type__": "Note", 2505 | "data": "", 2506 | "fields": [ 2507 | "Show branches not yet merged into current branch", 2508 | "git branch --no-merged", 2509 | "", 2510 | "" 2511 | ], 2512 | "flags": 0, 2513 | "guid": "c@|3gg#;C]", 2514 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2515 | "tags": [ 2516 | "command", 2517 | "git", 2518 | "shell" 2519 | ] 2520 | }, 2521 | { 2522 | "__type__": "Note", 2523 | "data": "", 2524 | "fields": [ 2525 | "Rebase master onto develop without checking it out", 2526 | "git rebase master develop", 2527 | "", 2528 | "" 2529 | ], 2530 | "flags": 0, 2531 | "guid": "zi:*@|txPH", 2532 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2533 | "tags": [ 2534 | "command", 2535 | "git", 2536 | "shell" 2537 | ] 2538 | }, 2539 | { 2540 | "__type__": "Note", 2541 | "data": "", 2542 | "fields": [ 2543 | "Show remote servers with URL displayed", 2544 | "git remote -v", 2545 | "", 2546 | "" 2547 | ], 2548 | "flags": 0, 2549 | "guid": "B*+[Z2P7KB", 2550 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2551 | "tags": [ 2552 | "command", 2553 | "git", 2554 | "shell" 2555 | ] 2556 | }, 2557 | { 2558 | "__type__": "Note", 2559 | "data": "", 2560 | "fields": [ 2561 | "Rename remote 'server1' to 'server2'", 2562 | "git remote rename server1 server2", 2563 | "", 2564 | "" 2565 | ], 2566 | "flags": 0, 2567 | "guid": "ti2E88+S5G", 2568 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2569 | "tags": [ 2570 | "command", 2571 | "git", 2572 | "shell" 2573 | ] 2574 | }, 2575 | { 2576 | "__type__": "Note", 2577 | "data": "", 2578 | "fields": [ 2579 | "Remove remote 'server1'", 2580 | "git remote rm server1", 2581 | "", 2582 | "" 2583 | ], 2584 | "flags": 0, 2585 | "guid": "NeFQQhW5^#", 2586 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2587 | "tags": [ 2588 | "command", 2589 | "git", 2590 | "shell" 2591 | ] 2592 | }, 2593 | { 2594 | "__type__": "Note", 2595 | "data": "", 2596 | "fields": [ 2597 | "Show last two commits with diffs", 2598 | "git log -p -2", 2599 | "", 2600 | "" 2601 | ], 2602 | "flags": 0, 2603 | "guid": "jEwY}^Te}u", 2604 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2605 | "tags": [ 2606 | "command", 2607 | "git", 2608 | "shell" 2609 | ] 2610 | }, 2611 | { 2612 | "__type__": "Note", 2613 | "data": "", 2614 | "fields": [ 2615 | "Show commit logs with stats", 2616 | "git log --stat", 2617 | "", 2618 | "" 2619 | ], 2620 | "flags": 0, 2621 | "guid": "8.]Jh.QO$", 2622 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2623 | "tags": [ 2624 | "command", 2625 | "git", 2626 | "shell" 2627 | ] 2628 | }, 2629 | { 2630 | "__type__": "Note", 2631 | "data": "", 2632 | "fields": [ 2633 | "
Show commit logs one per line
", 2634 | "git log --pretty=oneline", 2635 | "", 2636 | "" 2637 | ], 2638 | "flags": 0, 2639 | "guid": "Nt[d(Wa#l9", 2640 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2641 | "tags": [ 2642 | "command", 2643 | "git", 2644 | "shell" 2645 | ] 2646 | }, 2647 | { 2648 | "__type__": "Note", 2649 | "data": "", 2650 | "fields": [ 2651 | "Show commit logs with ascii graph", 2652 | "git log --graph", 2653 | "", 2654 | "" 2655 | ], 2656 | "flags": 0, 2657 | "guid": "N3Nv.H3g;i", 2658 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2659 | "tags": [ 2660 | "command", 2661 | "git", 2662 | "shell" 2663 | ] 2664 | }, 2665 | { 2666 | "__type__": "Note", 2667 | "data": "", 2668 | "fields": [ 2669 | "Show commit log for the last week", 2670 | "git log --since=1.week", 2671 | "", 2672 | "" 2673 | ], 2674 | "flags": 0, 2675 | "guid": "K9W#BB4D6c", 2676 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2677 | "tags": [ 2678 | "command", 2679 | "git", 2680 | "shell" 2681 | ] 2682 | }, 2683 | { 2684 | "__type__": "Note", 2685 | "data": "", 2686 | "fields": [ 2687 | "
Show prev commits for each lines 10-15 of file.rb
", 2688 | "git blame -L 10,15 file.rb", 2689 | "", 2690 | "" 2691 | ], 2692 | "flags": 0, 2693 | "guid": "DpA{?G=4xx", 2694 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2695 | "tags": [ 2696 | "command", 2697 | "git", 2698 | "shell" 2699 | ] 2700 | }, 2701 | { 2702 | "__type__": "Note", 2703 | "data": "", 2704 | "fields": [ 2705 | "Reapply stash 2", 2706 | "git stash apply stash@{2}", 2707 | "", 2708 | "" 2709 | ], 2710 | "flags": 0, 2711 | "guid": "ASur]9.2r1", 2712 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2713 | "tags": [ 2714 | "command", 2715 | "git", 2716 | "shell" 2717 | ] 2718 | }, 2719 | { 2720 | "__type__": "Note", 2721 | "data": "", 2722 | "fields": [ 2723 | "Reapply stashed changes along with the changes in index (staging the changes, for example)", 2724 | "git stash apply --index", 2725 | "", 2726 | "" 2727 | ], 2728 | "flags": 0, 2729 | "guid": "z0v]ev^m&4", 2730 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2731 | "tags": [ 2732 | "command", 2733 | "git", 2734 | "shell" 2735 | ] 2736 | }, 2737 | { 2738 | "__type__": "Note", 2739 | "data": "", 2740 | "fields": [ 2741 | "Drop stash 2", 2742 | "git stash drop stash@{2}", 2743 | "", 2744 | "" 2745 | ], 2746 | "flags": 0, 2747 | "guid": "K?U.M_8qGm", 2748 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2749 | "tags": [ 2750 | "command", 2751 | "git", 2752 | "shell" 2753 | ] 2754 | }, 2755 | { 2756 | "__type__": "Note", 2757 | "data": "", 2758 | "fields": [ 2759 | "Create branch 'mybranch' from stash", 2760 | "git stash branch mybranch", 2761 | "", 2762 | "" 2763 | ], 2764 | "flags": 0, 2765 | "guid": "frj9MIHYN;", 2766 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2767 | "tags": [ 2768 | "command", 2769 | "git", 2770 | "shell" 2771 | ] 2772 | }, 2773 | { 2774 | "__type__": "Note", 2775 | "data": "", 2776 | "fields": [ 2777 | "Delete all stashes", 2778 | "git stash clear", 2779 | "", 2780 | "" 2781 | ], 2782 | "flags": 0, 2783 | "guid": "vMkxJ_N}WR", 2784 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2785 | "tags": [ 2786 | "command", 2787 | "git", 2788 | "shell" 2789 | ] 2790 | }, 2791 | { 2792 | "__type__": "Note", 2793 | "data": "", 2794 | "fields": [ 2795 | "Show what's staged but not yet committed", 2796 | "git diff --staged", 2797 | "", 2798 | "" 2799 | ], 2800 | "flags": 0, 2801 | "guid": "C=%4u;E{qS", 2802 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2803 | "tags": [ 2804 | "command", 2805 | "git", 2806 | "shell" 2807 | ] 2808 | }, 2809 | { 2810 | "__type__": "Note", 2811 | "data": "", 2812 | "fields": [ 2813 | "Start binary search of commits to find bad commit", 2814 | "git bisect start", 2815 | "", 2816 | "https://git-scm.com/docs/git-bisect" 2817 | ], 2818 | "flags": 0, 2819 | "guid": "I;|,m~EPM+", 2820 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2821 | "tags": [ 2822 | "command", 2823 | "git", 2824 | "shell" 2825 | ] 2826 | }, 2827 | { 2828 | "__type__": "Note", 2829 | "data": "", 2830 | "fields": [ 2831 | "Mark current commit as broken during bisect", 2832 | "git bisect bad", 2833 | "", 2834 | "https://git-scm.com/docs/git-bisect" 2835 | ], 2836 | "flags": 0, 2837 | "guid": "snS(|j2h+c", 2838 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2839 | "tags": [ 2840 | "command", 2841 | "git", 2842 | "shell" 2843 | ] 2844 | }, 2845 | { 2846 | "__type__": "Note", 2847 | "data": "", 2848 | "fields": [ 2849 | "
Mark current commit as good during bisect
", 2850 | "git bisect good", 2851 | "", 2852 | "https://git-scm.com/docs/git-bisect" 2853 | ], 2854 | "flags": 0, 2855 | "guid": "nV[EjN,:@f", 2856 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2857 | "tags": [ 2858 | "command", 2859 | "git", 2860 | "shell" 2861 | ] 2862 | }, 2863 | { 2864 | "__type__": "Note", 2865 | "data": "", 2866 | "fields": [ 2867 | "Mark v2.2 as last known good commit during bisect (beginning of binary search)", 2868 | "git bisect good v2.2", 2869 | "", 2870 | "https://git-scm.com/docs/git-bisect" 2871 | ], 2872 | "flags": 0, 2873 | "guid": "B&(BK&(f`i", 2874 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2875 | "tags": [ 2876 | "command", 2877 | "git", 2878 | "shell" 2879 | ] 2880 | }, 2881 | { 2882 | "__type__": "Note", 2883 | "data": "", 2884 | "fields": [ 2885 | "How do you initiate bisect algorithm in git (several commands)", 2886 | "
Suppose you are trying to find the commit that broke a feature that was known to work in version v2.6.13-rc2 of your project. You start a bisect session as follows:

$ git bisect start
$ git bisect bad # Current version is bad
$ git bisect good v2.6.13-rc2 # v2.6.13-rc2 is known to be good

https://git-scm.com/docs/git-bisect" 2887 | ], 2888 | "flags": 0, 2889 | "guid": "z+Mb^@:H2B", 2890 | "note_model_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 2891 | "tags": [ 2892 | "command", 2893 | "git", 2894 | "shell" 2895 | ] 2896 | }, 2897 | { 2898 | "__type__": "Note", 2899 | "data": "", 2900 | "fields": [ 2901 | "Reset to original HEAD when finished with bisect", 2902 | "git bisect reset", 2903 | "", 2904 | "https://git-scm.com/docs/git-bisect" 2905 | ], 2906 | "flags": 0, 2907 | "guid": "zT>)P:<]^A", 2908 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2909 | "tags": [ 2910 | "command", 2911 | "git", 2912 | "shell" 2913 | ] 2914 | }, 2915 | { 2916 | "__type__": "Note", 2917 | "data": "", 2918 | "fields": [ 2919 | "Run 'test.sh' on each commit during bisect (automates designation of commit as \"good\" or \"bad\")", 2920 | "git bisect run test.sh", 2921 | "Note that the script should exit with code 0 if the current source code is good/old, and exit with a code between 1 and 127 (inclusive), except 125, if the current source code is bad/new.", 2922 | "" 2923 | ], 2924 | "flags": 0, 2925 | "guid": "P375+&ZLLM", 2926 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2927 | "tags": [ 2928 | "command", 2929 | "git", 2930 | "shell" 2931 | ] 2932 | }, 2933 | { 2934 | "__type__": "Note", 2935 | "data": "", 2936 | "fields": [ 2937 | "Search the working directory for \"foo()\"", 2938 | "git grep \"foo()\"", 2939 | "", 2940 | "" 2941 | ], 2942 | "flags": 0, 2943 | "guid": "w/@P4=C{XI", 2944 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2945 | "tags": [ 2946 | "command", 2947 | "git", 2948 | "shell" 2949 | ] 2950 | }, 2951 | { 2952 | "__type__": "Note", 2953 | "data": "", 2954 | "fields": [ 2955 | "View all the merge conflicts (if your working tree is in corresponding state)", 2956 | "git diff", 2957 | "", 2958 | "" 2959 | ], 2960 | "flags": 0, 2961 | "guid": "goZxIb4w*t", 2962 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2963 | "tags": [ 2964 | "command", 2965 | "git", 2966 | "shell" 2967 | ] 2968 | }, 2969 | { 2970 | "__type__": "Note", 2971 | "data": "", 2972 | "fields": [ 2973 | "See differences between two commits (\"commitid1\", \"commitid2\")", 2974 | "git diff commitid1 commitid2", 2975 | "", 2976 | "" 2977 | ], 2978 | "flags": 0, 2979 | "guid": "wb7|*(on45", 2980 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2981 | "tags": [ 2982 | "command", 2983 | "git", 2984 | "shell" 2985 | ] 2986 | }, 2987 | { 2988 | "__type__": "Note", 2989 | "data": "", 2990 | "fields": [ 2991 | "See the files (only filenames) changed between two commits (\"commitid1\", \"commitid2\")", 2992 | "git diff --name-only commitid1 commitid2 ", 2993 | "", 2994 | "" 2995 | ], 2996 | "flags": 0, 2997 | "guid": "D-cA", 2998 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 2999 | "tags": [ 3000 | "command", 3001 | "git", 3002 | "shell" 3003 | ] 3004 | }, 3005 | { 3006 | "__type__": "Note", 3007 | "data": "", 3008 | "fields": [ 3009 | "Undo non-pushed commits (if you are tracking branch origin/master)", 3010 | "git reset origin/master", 3011 | "", 3012 | "" 3013 | ], 3014 | "flags": 0, 3015 | "guid": "j+p@19O^.m", 3016 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3017 | "tags": [ 3018 | "command", 3019 | "git", 3020 | "shell" 3021 | ] 3022 | }, 3023 | { 3024 | "__type__": "Note", 3025 | "data": "", 3026 | "fields": [ 3027 | "Apply a patch (\"patchname.patch\")", 3028 | "
git apply -v patchname.patch
", 3029 | "", 3030 | "" 3031 | ], 3032 | "flags": 0, 3033 | "guid": "nsS,t6r6k~", 3034 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3035 | "tags": [ 3036 | "command", 3037 | "git", 3038 | "shell" 3039 | ] 3040 | }, 3041 | { 3042 | "__type__": "Note", 3043 | "data": "", 3044 | "fields": [ 3045 | "Re-checkout file (\"filename\") or files specified by path to version specified by rev (which may be specified using a SHA1 commit ID, branch name, or tag), overwriting any local changes.", 3046 | "git checkout rev filename", 3047 | "", 3048 | "" 3049 | ], 3050 | "flags": 0, 3051 | "guid": "rZOpQ[aZ<4", 3052 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3053 | "tags": [ 3054 | "command", 3055 | "git", 3056 | "shell" 3057 | ] 3058 | }, 3059 | { 3060 | "__type__": "Note", 3061 | "data": "", 3062 | "fields": [ 3063 | "Check out the client branch, figure out the patches from the common ancestor of the client and server branches (the common ancestor branched from master in the past), and then replay the patches from client that are not into common ancestor onto master.", 3064 | "git rebase --onto master server client", 3065 | "", 3066 | "Here are some diargrams: https://git-scm.com/book/ch3-6.html" 3067 | ], 3068 | "flags": 0, 3069 | "guid": "dOe.P/`?3w", 3070 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3071 | "tags": [ 3072 | "command", 3073 | "git", 3074 | "shell" 3075 | ] 3076 | }, 3077 | { 3078 | "__type__": "Note", 3079 | "data": "", 3080 | "fields": [ 3081 | "Create alias \"co\" for git checkout", 3082 | "git config --global alias.co checkout", 3083 | "", 3084 | "" 3085 | ], 3086 | "flags": 0, 3087 | "guid": "Q00f>K3|x]", 3088 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3089 | "tags": [ 3090 | "commands", 3091 | "git", 3092 | "shell" 3093 | ] 3094 | }, 3095 | { 3096 | "__type__": "Note", 3097 | "data": "", 3098 | "fields": [ 3099 | "Add \"unstage\" alias to git (for current user)", 3100 | "git config --global alias.unstage 'reset HEAD --'", 3101 | "", 3102 | "" 3103 | ], 3104 | "flags": 0, 3105 | "guid": "H+[B`$4X}+", 3106 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3107 | "tags": [ 3108 | "commands", 3109 | "git", 3110 | "shell" 3111 | ] 3112 | }, 3113 | { 3114 | "__type__": "Note", 3115 | "data": "", 3116 | "fields": [ 3117 | "Filter commit by author ('jdoe') in git log", 3118 | "git log --author jdoe", 3119 | "", 3120 | "" 3121 | ], 3122 | "flags": 0, 3123 | "guid": "OK9(#LMJ]r", 3124 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3125 | "tags": [ 3126 | "command", 3127 | "git", 3128 | "log", 3129 | "shell" 3130 | ] 3131 | }, 3132 | { 3133 | "__type__": "Note", 3134 | "data": "", 3135 | "fields": [ 3136 | "Filter commit by presense of \"pattern\" in commit message in git log", 3137 | "git log --grep pattern", 3138 | "", 3139 | "" 3140 | ], 3141 | "flags": 0, 3142 | "guid": "Oe9~pAq==p", 3143 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3144 | "tags": [ 3145 | "command", 3146 | "git", 3147 | "log", 3148 | "shell" 3149 | ] 3150 | }, 3151 | { 3152 | "__type__": "Note", 3153 | "data": "", 3154 | "fields": [ 3155 | "What parameter of git log should you use to specify that you want to see only commits matching all given patterns (with --grep option)?", 3156 | "--all-match", 3157 | "", 3158 | "" 3159 | ], 3160 | "flags": 0, 3161 | "guid": "L%bpn*{MB[", 3162 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3163 | "tags": [ 3164 | "command", 3165 | "git", 3166 | "log", 3167 | "shell" 3168 | ] 3169 | }, 3170 | { 3171 | "__type__": "Note", 3172 | "data": "", 3173 | "fields": [ 3174 | "Look for differences whose patch text contains added/removed lines that match <regex>.", 3175 | "git log -G<regex>", 3176 | "", 3177 | "https://git-scm.com/docs/git-log" 3178 | ], 3179 | "flags": 0, 3180 | "guid": "D]39x!74>j", 3181 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3182 | "tags": [ 3183 | "command", 3184 | "git", 3185 | "log", 3186 | "shell" 3187 | ] 3188 | }, 3189 | { 3190 | "__type__": "Note", 3191 | "data": "", 3192 | "fields": [ 3193 | "Stash all changes (including untracked and ignored files)", 3194 | "git stash --all", 3195 | "", 3196 | "https://git-scm.com/docs/git-stash" 3197 | ], 3198 | "flags": 0, 3199 | "guid": "bf+S])w`{#", 3200 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3201 | "tags": [ 3202 | "command", 3203 | "git", 3204 | "shell" 3205 | ] 3206 | }, 3207 | { 3208 | "__type__": "Note", 3209 | "data": "", 3210 | "fields": [ 3211 | "Stash files in repo including untracked files (but not ignored ones)", 3212 | "git stash --include-untracked", 3213 | "", 3214 | "https://git-scm.com/docs/git-stash" 3215 | ], 3216 | "flags": 0, 3217 | "guid": "H[wLNmJhnn", 3218 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3219 | "tags": [ 3220 | "command", 3221 | "git", 3222 | "shell" 3223 | ] 3224 | }, 3225 | { 3226 | "__type__": "Note", 3227 | "data": "", 3228 | "fields": [ 3229 | "Start git stash interactive mode (allows you to  interactively select changes, that would be stashed)", 3230 | "git stash -p", 3231 | "", 3232 | "https://git-scm.com/docs/git-stash" 3233 | ], 3234 | "flags": 0, 3235 | "guid": "tnbnb&KWxw", 3236 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3237 | "tags": [ 3238 | "command", 3239 | "git", 3240 | "shell" 3241 | ] 3242 | }, 3243 | { 3244 | "__type__": "Note", 3245 | "data": "", 3246 | "fields": [ 3247 | "Show status of the repository, ignoring untracked files", 3248 | "git status -uno", 3249 | "or --untracked-files=no. Other options - normal (Shows untracked files and directories), all (default, Also shows individual files in untracked directories).", 3250 | "" 3251 | ], 3252 | "flags": 0, 3253 | "guid": "sG?>pdX-Dy", 3254 | "note_model_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3255 | "tags": [ 3256 | "command", 3257 | "git", 3258 | "shell" 3259 | ] 3260 | } 3261 | ] 3262 | } 3263 | ], 3264 | "crowdanki_uuid": "a69dcedc-6d5b-11e6-adf3-8c705a50cbf0", 3265 | "deck_config_uuid": "a69dd698-6d5b-11e6-adf3-8c705a50cbf0", 3266 | "deck_configurations": [ 3267 | { 3268 | "__type__": "DeckConfig", 3269 | "autoplay": true, 3270 | "crowdanki_uuid": "a69dd698-6d5b-11e6-adf3-8c705a50cbf0", 3271 | "dyn": false, 3272 | "lapse": { 3273 | "delays": [ 3274 | 10 3275 | ], 3276 | "leechAction": 0, 3277 | "leechFails": 8, 3278 | "minInt": 1, 3279 | "mult": 0.0 3280 | }, 3281 | "maxTaken": 60, 3282 | "name": "Default", 3283 | "new": { 3284 | "bury": true, 3285 | "delays": [ 3286 | 1, 3287 | 10 3288 | ], 3289 | "initialFactor": 2500, 3290 | "ints": [ 3291 | 1, 3292 | 4, 3293 | 7 3294 | ], 3295 | "order": 1, 3296 | "perDay": 20, 3297 | "separate": true 3298 | }, 3299 | "replayq": true, 3300 | "rev": { 3301 | "bury": true, 3302 | "ease4": 1.3, 3303 | "fuzz": 0.05, 3304 | "ivlFct": 1.0, 3305 | "maxIvl": 36500, 3306 | "minSpace": 1, 3307 | "perDay": 100 3308 | }, 3309 | "timer": 0 3310 | }, 3311 | { 3312 | "__type__": "DeckConfig", 3313 | "autoplay": true, 3314 | "crowdanki_uuid": "a69e3016-6d5b-11e6-adf3-8c705a50cbf0", 3315 | "dyn": false, 3316 | "lapse": { 3317 | "delays": [ 3318 | 10 3319 | ], 3320 | "leechAction": 0, 3321 | "leechFails": 8, 3322 | "minInt": 1, 3323 | "mult": 0 3324 | }, 3325 | "maxTaken": 60, 3326 | "name": "Git", 3327 | "new": { 3328 | "bury": true, 3329 | "delays": [ 3330 | 1, 3331 | 10 3332 | ], 3333 | "initialFactor": 2500, 3334 | "ints": [ 3335 | 1, 3336 | 4, 3337 | 7 3338 | ], 3339 | "order": 1, 3340 | "perDay": 20, 3341 | "separate": true 3342 | }, 3343 | "replayq": true, 3344 | "rev": { 3345 | "bury": true, 3346 | "ease4": 1.3, 3347 | "fuzz": 0.05, 3348 | "ivlFct": 1, 3349 | "maxIvl": 36500, 3350 | "minSpace": 1, 3351 | "perDay": 100 3352 | }, 3353 | "timer": 0 3354 | } 3355 | ], 3356 | "desc": "", 3357 | "dyn": 0, 3358 | "extendNew": 10, 3359 | "extendRev": 50, 3360 | "media_files": [], 3361 | "name": "Software Engineering::git", 3362 | "note_models": [ 3363 | { 3364 | "__type__": "NoteModel", 3365 | "crowdanki_uuid": "a6a07e16-6d5b-11e6-adf3-8c705a50cbf0", 3366 | "css": ".card {\n font-familiy: arial;\n font-size: 20px;\n text-align: center;\n color: black;\n background-color: white;\n}", 3367 | "flds": [ 3368 | { 3369 | "font": "Arial", 3370 | "media": [], 3371 | "name": "Front", 3372 | "ord": 0, 3373 | "rtl": false, 3374 | "size": 20, 3375 | "sticky": false 3376 | }, 3377 | { 3378 | "font": "Arial", 3379 | "media": [], 3380 | "name": "Back", 3381 | "ord": 1, 3382 | "rtl": false, 3383 | "size": 20, 3384 | "sticky": false 3385 | } 3386 | ], 3387 | "latexPost": "\\end{document}", 3388 | "latexPre": "\\documentclass[12pt]{article}\n\\special{papersize=3in,5in}\n\\usepackage[utf8]{inputenc}\n\\usepackage{amssymb,amsmath}\n\\pagestyle{empty}\n\\setlength{\\parindent}{0in}\n\\begin{document}\n", 3389 | "name": "Basic-61fb1", 3390 | "req": [ 3391 | [ 3392 | 0, 3393 | "all", 3394 | [ 3395 | 0 3396 | ] 3397 | ] 3398 | ], 3399 | "sortf": 0, 3400 | "tags": [], 3401 | "tmpls": [ 3402 | { 3403 | "afmt": "{{FrontSide}}\n\n
\n\n{{Back}}", 3404 | "bafmt": "", 3405 | "bfont": "Arial", 3406 | "bqfmt": "", 3407 | "bsize": 12, 3408 | "did": null, 3409 | "name": "Card 1", 3410 | "ord": 0, 3411 | "qfmt": "{{Front}}" 3412 | } 3413 | ], 3414 | "type": 0, 3415 | "vers": [] 3416 | }, 3417 | { 3418 | "__type__": "NoteModel", 3419 | "crowdanki_uuid": "a6a2f2e0-6d5b-11e6-adf3-8c705a50cbf0", 3420 | "css": ".card {\n font-family: arial;\n font-size: 20px;\n text-align: center;\n color: black;\n background-color: white;\n}\n", 3421 | "flds": [ 3422 | { 3423 | "font": "Arial", 3424 | "media": [], 3425 | "name": "Purpose", 3426 | "ord": 0, 3427 | "rtl": false, 3428 | "size": 20, 3429 | "sticky": false 3430 | }, 3431 | { 3432 | "font": "Arial", 3433 | "media": [], 3434 | "name": "Command", 3435 | "ord": 1, 3436 | "rtl": false, 3437 | "size": 20, 3438 | "sticky": false 3439 | }, 3440 | { 3441 | "font": "Arial", 3442 | "media": [], 3443 | "name": "Extra", 3444 | "ord": 2, 3445 | "rtl": false, 3446 | "size": 20, 3447 | "sticky": false 3448 | }, 3449 | { 3450 | "font": "Arial", 3451 | "media": [], 3452 | "name": "Source", 3453 | "ord": 3, 3454 | "rtl": false, 3455 | "size": 20, 3456 | "sticky": true 3457 | } 3458 | ], 3459 | "latexPost": "\\end{document}", 3460 | "latexPre": "\\documentclass[12pt]{article}\n\\special{papersize=3in,5in}\n\\usepackage[utf8]{inputenc}\n\\usepackage{amssymb,amsmath}\n\\pagestyle{empty}\n\\setlength{\\parindent}{0in}\n\\begin{document}\n", 3461 | "name": "Command line", 3462 | "req": [ 3463 | [ 3464 | 0, 3465 | "all", 3466 | [ 3467 | 0 3468 | ] 3469 | ] 3470 | ], 3471 | "sortf": 0, 3472 | "tags": [ 3473 | "Linux", 3474 | "bash", 3475 | "command", 3476 | "tar" 3477 | ], 3478 | "tmpls": [ 3479 | { 3480 | "afmt": "{{FrontSide}}\n\n
\n
\n{{Extra}}\n
\n{{Source}}", 3481 | "bafmt": "", 3482 | "bqfmt": "", 3483 | "did": null, 3484 | "name": "TypeCard", 3485 | "ord": 0, 3486 | "qfmt": "{{Purpose}}\n
\n{{type:Command}}" 3487 | } 3488 | ], 3489 | "type": 0, 3490 | "vers": [] 3491 | }, 3492 | { 3493 | "__type__": "NoteModel", 3494 | "crowdanki_uuid": "a69ea2c6-6d5b-11e6-adf3-8c705a50cbf0", 3495 | "css": ".card {\n font-familiy: arial;\n font-size: 20px;\n text-align: center;\n color: black;\n background-color: white;\n}", 3496 | "flds": [ 3497 | { 3498 | "font": "Arial", 3499 | "media": [], 3500 | "name": "Front", 3501 | "ord": 0, 3502 | "rtl": false, 3503 | "size": 20, 3504 | "sticky": false 3505 | }, 3506 | { 3507 | "font": "Arial", 3508 | "media": [], 3509 | "name": "Back", 3510 | "ord": 1, 3511 | "rtl": false, 3512 | "size": 20, 3513 | "sticky": false 3514 | } 3515 | ], 3516 | "latexPost": "\\end{document}", 3517 | "latexPre": "\\documentclass[12pt]{article}\n\\special{papersize=3in,5in}\n\\usepackage[utf8]{inputenc}\n\\usepackage{amssymb,amsmath}\n\\pagestyle{empty}\n\\setlength{\\parindent}{0in}\n\\begin{document}\n", 3518 | "name": "Basic", 3519 | "req": [ 3520 | [ 3521 | 0, 3522 | "all", 3523 | [ 3524 | 0 3525 | ] 3526 | ] 3527 | ], 3528 | "sortf": 0, 3529 | "tags": [ 3530 | "bash" 3531 | ], 3532 | "tmpls": [ 3533 | { 3534 | "afmt": "{{FrontSide}}\n\n
\n\n{{Back}}", 3535 | "bafmt": "", 3536 | "bfont": "Arial", 3537 | "bqfmt": "", 3538 | "bsize": 12, 3539 | "did": null, 3540 | "name": "Card 1", 3541 | "ord": 0, 3542 | "qfmt": "{{Front}}" 3543 | } 3544 | ], 3545 | "type": 0, 3546 | "vers": [] 3547 | } 3548 | ], 3549 | "notes": [] 3550 | } --------------------------------------------------------------------------------