View on GitHub

geonode-training

Save changes to GitHub

Prepare the GeoNode fork

cat requirements.txt 
# -e git+https://github.com/GeoNode/geonode.git@3.3.x#egg=GeoNode

Add the Fork and Branch to the Code

image

Generate a Push Token

Commit the Changes to GitHub

cd /opt/geonode
git status

On branch geonode_training_32x
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   geonode/base/api/serializers.py
	modified:   geonode/base/forms.py
	modified:   geonode/base/models.py

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	geonode/base/migrations/0061_resourcebase_custom_md.py
	geonode/base/migrations/0062_auto_20210910_1445.py

no changes added to commit (use "git add" and/or "git commit -a")
git add geonode/base/migrations/0061_resourcebase_custom_md.py geonode/base/migrations/0062_auto_20210910_1445.py

git status

On branch geonode_training_32x
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	new file:   geonode/base/migrations/0061_resourcebase_custom_md.py
	new file:   geonode/base/migrations/0062_auto_20210910_1445.py

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   geonode/base/api/serializers.py
	modified:   geonode/base/forms.py
	modified:   geonode/base/models.py
git commit -a -m " - Added a custom_md field to the GeoNode ResourceBase metadata"
git status

On branch geonode_training_32x
nothing to commit, working tree clean
git log

commit b359f1c49a1196727a6af9fa916cb11b6d28dbdd (HEAD -> geonode_training_32x)
Author: afabiani <alessio.fabiani@geo-solutions.it>
Date:   Mon Sep 13 14:24:52 2021 +0100

     - Added a custom_md field to the GeoNode ResourceBase metadata

commit 911a0f14eb7204c622c807ba877b4a2dce3e3caa (afabiani/geonode_training_32x, 3.3.x)
Author: Toni <toni.schoenbuchner@csgis.de>
Date:   Tue Aug 31 17:57:04 2021 +0200

    added jcaceres85
    
    (cherry picked from commit 5553d1882718d38c742e6e4a86bf1ad51f14fb15)
    
    # Conflicts:
    #       .clabot
[...]

Create a new repository for the geonode project

The steps are more or less the same as above, except that this time we have to create a brand new repository from scratch instead of forking an existing one.

git remote add <a local name> https://github.com/<fork name>/my_geonode.git  <-- e.g.: git remote add afabiani https://github.com/afabiani/my_geonode.git

# Update the refs
git fetch --all

# Create a new branch
git checkout -b main

# Check the status of the local files and add all of them to the commit
git status
git add -A
git status

# Create a new commit along with a message
git commit -a -m " - My GeoNode"

# Finally push to the repository
git push afabiani main
![image](https://user-images.githubusercontent.com/1278021/133094720-a3bdc7e2-9e9e-4fa4-89cf-485abd3062b9.png)
cd /opt/geonode-project/my_geonode
vim requirements.txt

image

diff --git a/requirements.txt b/requirements.txt
index d4b80df..7700b59 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1 @@
-# -e git+https://github.com/GeoNode/geonode.git@3.3.x#egg=GeoNode
-GeoNode==3.3.x
\ No newline at end of file
+-e git+https://github.com/afabiani/geonode.git@geonode_training_32x#egg=GeoNode
git status

On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   requirements.txt

no changes added to commit (use "git add" and/or "git commit -a")
git commit -m " - Link my_geonode to the correct GeoNode dist" requirements.txt 

[main 7e62c60]  - Link my_geonode to the correct GeoNode dist
 1 file changed, 1 insertion(+), 2 deletions(-)
git push afabiani main

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 362 bytes | 362.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/afabiani/my_geonode.git
   a40f891..7e62c60  main -> main

Next Section: Add an App with APIs to geonode-project