Silly Git question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eastwind
    Apprentice
    • Dec 2019
    • 79

    Silly Git question

    What are the git URLs (for cloning) for v 4.2.0 and master?

    I see many references to http://github/angband/angband and I can clone that, but I'm not sure what I'm getting or how to get the other of the two I'm interested in.

    (For VS integration, which I am trying to write some documentation up for, it's important to know the URL and clone from within VS rather than the web site.)
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9637

    #2
    There's a branch button near the top left. By default it shows master; if you want 4.2.0, change to 4.2-release.

    That said, I think if you just clone angband/angband by default you get all the branches.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • eastwind
      Apprentice
      • Dec 2019
      • 79

      #3
      I'm not using the git web page, I'm trying to figure out how to use git from within Visual Studio. So there's no pull-down for which version to get, you have to specify that via the url you clone.

      Anyway, angband/angband seems to have given me master, as I was able to fetch the changes you committed today, including the one for #4236.

      Hopefully I'll be able to offer up a pull request soon for the other VS compilation fixes.

      Comment

      • takkaria
        Veteran
        • Apr 2007
        • 1951

        #4
        VS must have a way to handle this that isn't using a URL, because URLs don't specify particular branches in git. You have a URL that allows you to clone a whole repository, which includes all branches and revisions. Then in your local copy you choose ('check out') what you want in your working directory.
        takkaria whispers something about options. -more-

        Comment

        • Pete Mack
          Prophet
          • Apr 2007
          • 6883

          #5
          You want angband/angband. Don't worry about other stuff; the only important git synchronization is to keep your branch synced with HEAD, and to push changes for staging at github. All other actions will be local (commit, diff, log, etc)

          Comment

          • eastwind
            Apprentice
            • Dec 2019
            • 79

            #6
            What I did was make a fork, Eastwind921/Angband, off of angband/angband (the master) using the web interface. But then when I cloned (which I did using Visual Studio's GitHub extension) I cloned Http://github.com/angband/angband, when I should have cloned my fork instead, which is apparently Http://github.com/Eastwind921/angband.

            And so then I wasn't able to push my changes properly.

            So anyone else reading, don't do that.

            Try number 2 is underway using a clone of Http://github.com/Eastwind921/angband, we'll see how that works for me.

            Comment

            • eastwind
              Apprentice
              • Dec 2019
              • 79

              #7
              I'm still struggling with Git.

              The first change got done properly and merged in by Nick.

              Then I started the second change, the addition of 5 new files. I first synced my local repository, then added the files, then staged them, then stashed them, then pushed them to Eastwind921/angband.

              But at that point the web client showed Eastwind921/angband being 2 commits ahead and one commit behind master - rather than 1 commit ahead as I expected. When I ran the compare, it was still showing me the 3 edited files from the prior commit as well as the 5 new files.

              So I thought I should revert the second push, and I did that, and now it shows me *3* commits ahead, as the reversion didn't erase the prior push, it just made another change removing those files.

              Ugh! deeper and deeper.

              Does git expect me to set up a fresh fork off of master for each thing I want to commit? That's easy enough in the web client, but the work needed on the local side to download the repository, get the VS project files working, etc, is non-trivial.

              What do I do from here?

              Comment

              • Pete Mack
                Prophet
                • Apr 2007
                • 6883

                #8
                reversion does not erase changes, just undoes them (so they still show in the lot). And you will be ahead on commits until the pull request is processed.

                Comment

                • eastwind
                  Apprentice
                  • Dec 2019
                  • 79

                  #9
                  What does 'until the pull request is processed' mean? Nick did his thing, I thought that was all that needed to happen. Do I need to wait on GitHub to do some post-merge processing?

                  Comment

                  • Pete Mack
                    Prophet
                    • Apr 2007
                    • 6883

                    #10
                    My bad. You can see the difference here:
                    A free, single-player roguelike dungeon exploration game - Comparing angband:master...Eastwind921:master angband/angband

                    Soat least sone change is outstanding

                    Comment

                    • eastwind
                      Apprentice
                      • Dec 2019
                      • 79

                      #11
                      Thanks, that shows what I'm looking at that is causing my question.

                      I don't get why the first line (5d2e4f5) is showing up. That change was pushed to my branch then pulled to master by Nick, so why should it still be showing as a difference that's in my branch but not master?

                      So another way to ask my same question is, after you push a change to your private fork and then get it merged into master, what do you have to do to your private fork to clean or reset or sync it with master so it's ready for the next change?

                      Comment

                      • eastwind
                        Apprentice
                        • Dec 2019
                        • 79

                        #12
                        I guess what I have to do is delete my fork using the web interface and recreate it after every push. If i do that it will get the same name, and my local repository will automatically retarget to the clean fork. I read something about being generous with forks, but I didn't quite know what was expected.

                        Comment

                        • backwardsEric
                          Knight
                          • Aug 2019
                          • 527

                          #13
                          Originally posted by eastwind
                          So another way to ask my same question is, after you push a change to your private fork and then get it merged into master, what do you have to do to your private fork to clean or reset or sync it with master so it's ready for the next change?
                          I'm still a novice at this as well, but this seems to work better than deleting your private fork and recreating it:
                          • Keep the master in your fork only for changes that were made in Angband's master fork. When new changes come out in Angband's master pull them into your master, i.e. with the git command line interface make sure you are in the master branch in your fork and run
                            Code:
                            git pull https://github.com/angband/angband.git
                            .
                          • For a related set of changes you want to make, create a branch in your fork. Usually you'd probably want the branch to be based off the master branch in your fork.
                          • When you are ready to send your changes to the maintainer, push that branch to github and create a pull request for Angband from github's web interface.
                          • If new changes to Angband's master come out while you're still working on a change, pull them into the master branch of your fork. In the branch for your change that's still in progress, run
                            Code:
                            git rebase master
                            so it picks up the new changes from upstream.

                          Comment

                          • eastwind
                            Apprentice
                            • Dec 2019
                            • 79

                            #14
                            Thanks, i need all the help I can get!

                            I tried deleting my master fork and reforking, but it didn't help - the new fork still showed everything I'd ever done, and every pull request I start to make includes every change I've ever done, not just the most recent change - even though Nick has accepted the other stuff and the delta is really just the most recent change.

                            So my main fork, Eastwind921/master has all this junk in it I can't clear. It says it's up-to-date with master, they're on the same commit
                            d3be7e2541fc12abc77d3d2f126d6c64a4ccf36b

                            I found some decent tutorial stuff to read, and that's helping, maybe things will become clearer in another couple of chapters...

                            Comment

                            • backwardsEric
                              Knight
                              • Aug 2019
                              • 527

                              #15
                              Originally posted by eastwind
                              Thanks, i need all the help I can get!

                              I tried deleting my master fork and reforking, but it didn't help - the new fork still showed everything I'd ever done, and every pull request I start to make includes every change I've ever done, not just the most recent change - even though Nick has accepted the other stuff and the delta is really just the most recent change.

                              So my main fork, Eastwind921/master has all this junk in it I can't clear. It says it's up-to-date with master, they're on the same commit
                              d3be7e2541fc12abc77d3d2f126d6c64a4ccf36b
                              Did you delete both your fork on GitHub and the local copy on your computer? After I deleted both, reforked, and then followed the procedure in my post above, newly generated pull requests were clean and only had the commits from the branch I had pushed to GitHub. Before that, I saw what you see, extra commits in the pull requests which Nick was kind enough to ignore.

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎