Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

clone CTSM from github in a Macbook

scipeak

kefeng
New Member
Please fill in all relevant information below, deleting the red text after you have read it.

Before submitting a help request, please check to see if your question is already answered:
- Search the forums for similar issues
- Check the CIME troubleshooting guide to see if any suggestions there solve your problem
- Check any other relevant CESM documentation



What version of the code are you using?
CTSM
git clone --recursive GitHub - ESCOMP/CTSM: Community Terrestrial Systems Model (includes the Community Land Model of CESM) CTSM

Have you made any changes to files in the source tree?
no


Describe every step you took leading up to the problem:
4、download CTSM (~/ctsm)
cd ~
git clone --recursive GitHub - ESCOMP/CTSM: Community Terrestrial Systems Model (includes the Community Land Model of CESM) CTSM
cd ctsm

7、
cd ~/CTSM
submodule update --init --recursive


If this is a port to a new machine: Please attach any files you added or changed for the machine port (e.g., config_compilers.xml, config_machines.xml, and config_batch.xml) and tell us the compiler version you are using on this machine.
Please attach any log files showing error messages or other useful information.

- If the error occurs during the build, please attach the appropriate build log file showing the compilation error message.
- If the error occurs during the run, please attach all log files from the run (cpl.log, cesm.log and all component log files).



Describe your problem or question:

1、❯ git submodule update --init --recursive
Submodule path 'components/cism': checked out '0a4e6cfe8828cd28cdab06f83a7c1eb464c1ca8c'
fatal: remote error: upload-pack: not our ref ee766637f42871288f1927ccfe3f465cea90d2c4
fatal: unable to get 'components/cism/cime' which is recorded as revision ee766637f42871288f1927ccfe3f465cea90d2c4. Directly fetching that commit failed.
fatal: could not recursively update submodule path 'components/cism'


2、❯ cd components/cism/cime
git fetch
git checkout 1006c39f59577d47994fb3fb897566b2b8fa12ed
Note: switching to '1006c39f59577d47994fb3fb897566b2b8fa12ed'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branch by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c <new-branch-name>

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 1006c39f5 Merge pull request #4802 from ekluzek/change_min_mem_for_batch
❯ cd ..
git add cime
git commit -m "Fix submodule cime reference to current commit"
git push
[detached HEAD 163da92] Fix submodule cime reference to current commit

Your name and email address were configured automatically based on your username and hostname. Please check that they are correct.
You can suppress this message by setting them explicitly:

git config --global user.name "Your Name"
git config --global user.email you@example.com

Afterwards you can amend the author of this commit with:

git commit --amend --reset-author

1 file changed, 1 insertion(+), 1 deletion(-)
fatal: You are not currently on a branch.
To push the current (detached HEAD) history, use

git push origin HEAD:<remote-branch-name>
 

scipeak

kefeng
New Member
❯ ./bin/git-fleximod update
fates up to date.
Recursively checking out submodules of fates
Traceback (most recent call last):
File "/Users/wang/CTSM/./bin/git-fleximod", line 8, in <module>
sys.exit(main())
File "/Users/wang/CTSM/.lib/git-fleximod/git_fleximod/git_fleximod.py", line 348, in main
submodules_update(gitmodules, root_dir, fxrequired, force)
File "/Users/wang/CTSM/.lib/git-fleximod/git_fleximod/git_fleximod.py", line 254, in submodules_update
submodules_update(gitsubmodules, repodir, newrequiredlist, force=force)
File "/Users/wang/CTSM/.lib/git-fleximod/git_fleximod/git_fleximod.py", line 223, in submodules_update
_, needsupdate, localmods, testfails = submod.status()
File "/Users/wang/CTSM/.lib/git-fleximod/git_fleximod/submodule.py", line 110, in status
ahash = parts[0][1:]
IndexError: list index out of range
 

jedwards

CSEG and Liaisons
Staff member
Please start from the beginning following the instructions.
Do not use the --recursive option to git clone.
Code:
git clone GitHub - ESCOMP/CTSM: Community Terrestrial Systems Model (includes the Community Land Model of CESM) CTSM
cd CTSM
./bin/git-fleximod update
 

scipeak

kefeng
New Member
Please start from the beginning following the instructions.
Do not use the --recursive option to git clone.
Code:
git clone GitHub - ESCOMP/CTSM: Community Terrestrial Systems Model (includes the Community Land Model of CESM) CTSM
cd CTSM
./bin/git-fleximod update
Thanks a lot, the clone is ok now.
 
Top