Add git and github tips and tricks to developer notes #8178

pull sipa wants to merge 1 commits into bitcoin:master from sipa:docgit changing 1 files +48 −0
  1. sipa commented at 11:06 PM on June 8, 2016: member

    No description provided.

  2. btcdrak commented at 11:16 PM on June 8, 2016: contributor

    Nice advice!

    utACK a70df2d

  3. in doc/developer-notes.md:None in a70df2d6de outdated
     438 | +  This will add a an `upstream-pull` remote to your git repository, which can be fetched using `git fetch --all`
     439 | +  or `git fetch upstream-pull`. Afterwards, you can use `upstream-pull/NUMBER/head` in arguments to `git show`,
     440 | +  `git checkout` and anywhere a commit id would be acceptable to see the changes from that commit.
     441 | +
     442 | +- To verify whether two commits result in the exact same tree, you can find out what their *tree id* is using
     443 | +  `git show -s --format="%T" commit` for each, and then compare the tree ids.
    


    luke-jr commented at 11:17 PM on June 8, 2016:

    Why not just git diff commit..commit?


    sipa commented at 1:20 PM on June 9, 2016:

    I assume that works as well, but it seems less certain. If the tree hash is identical, the resulting code necessarily is.


    MarcoFalke commented at 1:24 PM on June 9, 2016:

    I am usually using what @luke-jr suggest, as the additional step to determine the tree id is not needed. If there is no difference between two commits, the tree id should be identical as well.

  4. luke-jr commented at 11:18 PM on June 8, 2016: member

    Maybe add that git worktree or whatever you suggested the other day?

  5. laanwj commented at 5:19 AM on June 9, 2016: member

    ACK

    Maybe add that git worktree or whatever you suggested the other day?

    Can be added later, no need to do everything in this pull. There's also a lot of git commands in the wild that are too old to support it, such as the one in Ubuntu 14.04.

  6. laanwj added the label Docs and Output on Jun 9, 2016
  7. fanquake commented at 6:28 AM on June 9, 2016: member

    ACK a70df2d

  8. jonasschnelli commented at 7:00 AM on June 9, 2016: contributor

    ACK a70df2d6decfb56cfc07aed361bcfe0076766f4b

  9. in doc/developer-notes.md:None in a70df2d6de outdated
     409 | +
     410 | +  This may make it much clearer what caused the conflict. In this style, you can often just look
     411 | +  at what changed between *original* and *theirs*, and mechnically apply that to *yours* (or the other way around).
     412 | +
     413 | +```
     414 | +git config merge.conflictstyle diff3`
    


    paveljanik commented at 7:20 AM on June 9, 2016:

    The back-tick at the end of the command should probably be removed.


    sipa commented at 1:23 PM on June 9, 2016:

    Inlined it into the first sentence instead.

  10. in doc/developer-notes.md:None in a70df2d6de outdated
     433 | +[remote "upstream-pull"]
     434 | +        fetch = +refs/pull/*:refs/remotes/upstream-pull/*
     435 | +        url = git@github.com:bitcoin/bitcoin.git
     436 | +```
     437 | +
     438 | +  This will add a an `upstream-pull` remote to your git repository, which can be fetched using `git fetch --all`
    


    paveljanik commented at 7:22 AM on June 9, 2016:

    "a an"


    sipa commented at 1:23 PM on June 9, 2016:

    Fixed.

  11. paveljanik commented at 7:23 AM on June 9, 2016: contributor

    This is very useful! Thanks!

  12. MarcoFalke commented at 11:25 AM on June 9, 2016: member

    Concept ACK, but needs the tiny nits fixed.

  13. sipa force-pushed on Jun 9, 2016
  14. sipa force-pushed on Jun 9, 2016
  15. sipa commented at 1:31 PM on June 9, 2016: member

    @MarcoFalke Ok, removed it. The alternative you're using is too trivial to list.

  16. sipa force-pushed on Jun 9, 2016
  17. sipa force-pushed on Jun 9, 2016
  18. Add git and github tips and tricks to developer notes 31444491f2
  19. in doc/developer-notes.md:None in ac66b2381c outdated
     403 | +        ===
     404 | +        theirs
     405 | +        >>>
     406 | +
     407 | +  This may make it much clearer what caused the conflict. In this style, you can often just look
     408 | +  at what changed between *original* and *theirs*, and mechnically apply that to *yours* (or the other way around).
    


    paveljanik commented at 1:43 PM on June 9, 2016:

    mechanically


    sipa commented at 1:45 PM on June 9, 2016:

    Thanks, fixed!

  20. sipa force-pushed on Jun 9, 2016
  21. laanwj merged this on Jun 9, 2016
  22. laanwj closed this on Jun 9, 2016

  23. laanwj referenced this in commit f7b1bfc9a3 on Jun 9, 2016
  24. in doc/developer-notes.md:None in 31444491f2
     420 | +  even work when combined with the `-w` or `--word-diff` options described above.
     421 | +
     422 | +- When looking at other's pull requests, it may make sense to add the following section to your `.git/config`
     423 | +  file:
     424 | +
     425 | +        [remote "upstream-pull"]
    


    MarcoFalke commented at 11:06 AM on June 21, 2016:

    nit: Please use 4 spaces (not 6)

  25. codablock referenced this in commit f82ddbea1b on Sep 16, 2017
  26. codablock referenced this in commit c81e6dd528 on Sep 19, 2017
  27. codablock referenced this in commit 209a4d63bd on Dec 22, 2017
  28. andvgal referenced this in commit 5385726382 on Jan 6, 2019
  29. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me