Forum > General
How to use git
af0815:
git init is only to use if you want a new repository of your own. https://git-scm.com/docs/git-init
If you want to work on a 'normal' git repository you have to use clone first (NOT init). After this you can switch to the branch or tag you want.
Earlier in the thread you have used the clone command and after this you can switch with 'git branch lazarus_2_0_12 origin/lazarus_2_0_12' and followed by a "git checkout lazarus_2_0_12"
Martin_fr:
A probably because I tried a branch.....
--- Code: Bash [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---git switch -c lazarus_2_0_12 FETCH_HEAD
should do (with tags, branches and commits).
THe "lazarus_2_0_12" you can freely name.
You can do that in your existing folder, if you still have it.
Martin_fr:
--- Quote from: af0815 on November 22, 2021, 06:48:49 pm ---git init is only to use if you want a new repository of your own. https://git-scm.com/docs/git-init
If you want to work on a 'normal' git repository you have to use clone first (NOT init). After this you can switch to the branch or tag you want.
Earlier in the thread you have used the clone command and after this you can switch with 'git branch lazarus_2_0_12 origin/lazarus_2_0_12' and followed by a "git checkout lazarus_2_0_12"
--- End quote ---
I intentionally did specify steps, without "clone".
init, then fetch => allows you to fetch any single commit.
It is possible to fetch as many individual commits (even from different repos) as you want. They all will go to FETCH_HEAD.
So then you must give them a branch/name of their own, before fetching the next.
That is done with:
git switch -c MyName FETCH_HEAD
After that you can switch to it with just
git switch MyName
Note that branches fetched like this, to not have a remote to follow.
git pull / git remote update / git fetch
will NOT get any updates for them.
If you are happy with just having downloaded the commit (like an svn export), and do no longer need to interact with the remote, then you can delete the .git folder.
trev:
--- Quote from: BosseB on November 22, 2021, 01:46:42 pm ---
--- Quote from: trev on November 22, 2021, 12:11:37 pm ---1. $ git clone -b lazarus_2_0_12 https://gitlab.com/freepascal.org/lazarus/lazarus.git laz2012
2. $ git clone -b release_3_2_0 https://gitlab.com/freepascal.org/fpc/source.git fpc320
This only downloads the specified branch. Simples :)
--- End quote ---
So how do you find the tag names you used in the commands above?
--- End quote ---
If you go to the URLs I gave for each of Lazarus and FPC using a web browser, you can simply use the dropdown box that will currently say "main" to see all the other branch names. However, given the "starter" branch names I provided, you could probably guess the rest for official releases.
dbannon:
Depending on your need, maybe you don't need to use git at all ? gitlab will allow you to download a zip file of whatever branch/tag you nominate. Its a reasonably quick 50meg download. If you are not planning to generate pull requests or update daily, I suggest its a lot easier.
You just use the gitlab webpage, navigate to Lazarus, select the tag/branch you want from left hand side, click the download button, second rightmost button. No knowledge of git required, no install of git required, no history.
Davo
Navigation
[0] Message Index
[#] Next page
[*] Previous page