I'm not able to ( git push) files in apps folder

i’m not able to push apps/erpnext to git repository

super@localhost:~/frappe-bench$ ls apps/
erpnext  frappe  payments
super@localhost:~/frappe-bench$ git add apps/erpnext/*
fatal: Pathspec 'apps/erpnext/attributions.md' is in submodule 'apps/erpnext
super@localhost:~/frappe-bench$ git commit -m 'ok'
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
        modified:   apps/frappe (modified content)
        modified:   logs/backup.log
        modified:   logs/bench.log
        modified:   logs/worker.error.log
        modified:   logs/worker.log
        deleted:    sites/ratina_erp/private/backups/20220913_090003-ratina_erp-site_config_backup.json
        deleted:    sites/ratina_erp/private/backups/20220913_150004-ratina_erp-site_config_backup.json
        deleted:    sites/ratina_erp/private/backups/20220913_210003-ratina_erp-database.sql.gz
        deleted:    sites/ratina_erp/private/backups/20220913_210003-ratina_erp-site_config_backup.json
        deleted:    sites/ratina_erp/private/backups/20220914_030004-ratina_erp-database.sql.gz
        deleted:    sites/ratina_erp/private/backups/20220914_030004-ratina_erp-site_config_backup.json
        deleted:    sites/ratina_erp/private/backups/20220914_090003-ratina_erp-database.sql.gz

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        sites/ratina_erp/private/backups/20220914_150004-ratina_erp-site_config_backup.json
        sites/ratina_erp/private/backups/20220914_210004-ratina_erp-database.sql.gz
        sites/ratina_erp/private/backups/20220914_210004-ratina_erp-site_config_backup.json
        sites/ratina_erp/private/backups/20220915_030004-ratina_erp-database.sql.gz
        sites/ratina_erp/private/backups/20220915_030004-ratina_erp-site_config_backup.json
        sites/ratina_erp/private/backups/20220915_090004-ratina_erp-database.sql.gz
        sites/ratina_erp/private/backups/20220915_090004-ratina_erp-site_config_backup.json

no changes added to commit (use "git add" and/or "git commit -a")

Hi @Abdullah_Yassin,

first, go to the app directory
then apply command

git add .
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/username/repositories_name.git
git push -u origin main

Then check it.


Reference:

Thank You!

2 Likes

it’s not working

super@localhost:~$ cd frappe-bench/
super@localhost:~/frappe-bench$ git add apps/frappe
super@localhost:~/frappe-bench$ git commit -m "first commit"
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
        modified:   apps/frappe (modified content)
        modified:   logs/backup.log
        modified:   logs/bench.log
        deleted:    sites/ratina_erp/private/backups/20220914_090003-ratina_erp-site_config_backup.json

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        logs/scheduler.log.1
        logs/scheduler.log.2
        sites/ratina_erp/logs/

no changes added to commit (use "git add" and/or "git commit -a")

Please follow its step.

1 step:

super@localhost:~/frappe-bench/apps/your_app$

#eg. super@localhost:~/frappe-bench/apps/erpnext$

2 step:

super@localhost:~/frappe-bench/apps/your_app$ git add .

then one by one command add.

Thank You!

it’s not working

super@localhost:~/frappe-bench$ cd apps/erpnext/
super@localhost:~/frappe-bench/apps/erpnext$ git add .
super@localhost:~/frappe-bench/apps/erpnext$ git commit -m "first commit"
On branch develop
Your branch is up to date with 'upstream/develop'.

nothing to commit, working tree clean
super@localhost:~/frappe-bench/apps/erpnext$ git branch -M main
super@localhost:~/frappe-bench/apps/erpnext$ git add .
super@localhost:~/frappe-bench/apps/erpnext$ git remote add origin https://github.com/RatinaTeam/ratina-system.git
super@localhost:~/frappe-bench/apps/erpnext$ git push -u origin main
To https://github.com/RatinaTeam/ratina-system.git
 ! [rejected]        main -> main (fetch first)
error: failed to push some refs to 'https://github.com/RatinaTeam/ratina-system.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

create a repo in GitHub then apply the command because the repo did not found in your account.

and maintain the same name repo like if you upload a file or folder of erpnext then create a repo name as erpnext.
for better understand.

The repo it’s already existing in github ( private )
It’s working fine
But apps/erpnext and apps/frappe
It’s not possible to pushed
Those apps pushed empty