-2

For almost a year, I have simply been copying the zip file anytime new changes were made to avoid dealing with git pull fetch track origin rebase master slave.

How hard can it possibly be to simply download or clone a repository, and then set it to track changes?
And, while you are at it, don't overwrite my changes.
I am not a developer, so have no need to push(upload).

Are you able to track an HTTPS address or does it have to be SSSH?

I simply want to track changes on https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x
That's it.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Jaime
  • 21
  • 4
  • 1
    Also please don't add language tags that have nothing to do with the question. – mkrieger1 Dec 16 '21 at 20:38
  • 1
    Also it seems to me that what you describe should not be difficult at all. If you want to ask why what you are doing doesn't work, please be more specific (read: [ask] and: [mre]). – mkrieger1 Dec 16 '21 at 20:40
  • nope, its not a rant, it is a legitimate question, i did find other posts all with the same question and all with the same complicated answers which really doesn't actually help/work unless you have a few years experience. – Jaime Dec 16 '21 at 20:42
  • also there is no need to down vote my question, if you know the answer or a newer method since both vscode and git continue to evolve then you can share that so that myself and others can learn – Jaime Dec 16 '21 at 20:51
  • (1) clone the repository - do not download a zip file! Zip file = *one* commit, clone = *all* commits. You need all commits. (2) `git branch --set-upstream-to=origin/foo foo` to make local branch name `foo` have `origin/foo` set as its upstream. Add a different remote if needed. (3) Run `git fetch` (or `git remote update` if you have multiple remotes); `git status` will now inspect the current commit on the current branch, vs its designated remote-tracking name. Until you fetch, the remote-tracking name only remembers the *last* fetch, so you must fetch. – torek Dec 16 '21 at 21:31
  • The fact is that Git is overkill for what you want. But almost anything else is, well, "underkill". There is no happy medium. You will be unhappy. – torek Dec 16 '21 at 21:33
  • Does this answer your question? [Make an existing Git branch track a remote branch?](https://stackoverflow.com/questions/520650/make-an-existing-git-branch-track-a-remote-branch) – Nicolas Dec 18 '21 at 21:53

2 Answers2

2

I just tested, with git clone -b:

C:\Users\vonc\git\tests>git clone https://github.com/MarlinFirmware/Marlin -b bugfix-2.0.x
Cloning into 'Marlin'...
...

C:\Users\vonc\git\tests\Marlin>git br -avv
* bugfix-2.0.x                6dc056f771 [origin/bugfix-2.0.x]  Fix UTF-8 errror in configuration embed and retrieve  (#23303)
  remotes/origin/1.0.x        9495731c57 Disable integration testing
...

Meaning: I clone and am directly on the right local branch bugfix-2.0.x, which tracks the right remote tracking branch origin/bugfix-2.0.x.

Any subsequent git pull will update that branch by default.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

Thank you Torek and VonC i did figure it out last night after a LinkdIn learning video, but you two basically nailed it, i did a fresh git checkout --track remotes/2.0.9.2/bugfix-2.0.x followed by git br -avv and i am all set. Torek you are correct about overkill and no happy median but what doesn't kill me makes me stronger, plus maintaining firmware on 3 different printers, my next lesson will be for better versioning.

Jaime
  • 21
  • 4