Api Key Spring boot

I have an api Key in my application.properties file in my spring boot app but when I try it to push on the GitHub so it gives me an error that the secret key will not be pushed to GitHub ! .. Can someone help me what to do in this case ?
328 Replies
JavaBot
JavaBot3d ago
This post has been reserved for your question.
Hey @Danix! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st3d ago
just don't include the key in the repository? Note that if you already committed it, you'll need to remove or amend that comment (not just revert it)
JavaBot
JavaBot3d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Danix
DanixOP3d ago
i have the api key in the app.properties then what to do in this case?
Muhammad Hasnat
To address this issue, you have a few options: Environment Variables: Store the API key in an environment variable and access it using System.getenv() instead of directly reading it from the application.properties file. This way, the key will not be included in your repository. .gitignore: Exclude the application.properties file from being pushed to GitHub by adding it to a .gitignore file in the project root. This prevents the file from being visible to anyone who doesn't have direct access to your local machine. External Configuration: Store the API key in an external configuration file (e.g., a properties file or JSON file) that is not committed to your repository. Your application can then read the key from this file at runtime. Secrets Manager: Use a secrets manager service like Vault or AWS Secrets Manager to securely store and retrieve the API key. This provides a more robust and centralized solution for managing sensitive data. Masking the API Key: Consider masking the API key in the output of Git commands like git diff or git log. This can help reduce the visibility of the key, even though it's still technically in the repository. Choose the approach that best suits your project's requirements and security needs.
Danix
DanixOP3d ago
hey i dont know how while trying to push the changes to the git i lost my yesterday's code
Muhammad Hasnat
oh sad
Danix
DanixOP3d ago
i used this commands
git rm --cached
git rm --cached
Muhammad Hasnat
you want to get back your code?
Danix
DanixOP3d ago
yeh
Muhammad Hasnat
ok wait Try this Check Your Local Files: Look for your yesterday's code in your project directory. Since git rm --cached doesn't delete the files from your computer, they should still be there. If you find them, add them back to git: Bash git add. # Adds all changes in the current directory and its subdirectories git commit -m "Recover lost changes"
Danix
DanixOP3d ago
the code is deleted from my local repo not from the remote repo ! idk how this happens
Muhammad Hasnat
code is also delete from your local pc?
Danix
DanixOP3d ago
yehh idk how
Muhammad Hasnat
you check your recycle bin?
Danix
DanixOP3d ago
So let me tell you the whole scenerio i have parent folder and it have its own sub folders backend and frontend so the sub folders have the git ignore and git attribute things so i deleted them few mins ago so may be thats how my code got delted from locally
Muhammad Hasnat
Has this scenario happened to you? .gitignore Removed: When you deleted the .gitignore file, files previously ignored by Git (like build artifacts, temporary files, or dependencies) became tracked. .gitattributes Removed: Deleting .gitattributes might have affected how Git handles line endings or other file attributes, potentially leading to unexpected changes in your working directory. Git Commands: If you executed commands like git add., git commit -m "some message", and git push, those previously ignored files would have been added to your Git history, potentially overwriting your actual code files with unintended changes.
Danix
DanixOP3d ago
so what to do now at this time ?
Muhammad Hasnat
1. Recover .gitignore and .gitattributes: Check Recycle Bin/Trash: Look for the deleted .gitignore and .gitattributes files in your Recycle Bin or Trash and restore them if found. File Recovery Software: If not in the Recycle Bin, try using file recovery software (like Recuva or TestDisk) to recover them. Remote Repository: If you have a remote Git repository, you can clone or fetch the latest version to get back the .gitignore and .gitattributes files. 2. Restore Previous Commit: Once you have the .gitignore and .gitattributes files back, use git reflog to find the commit before you deleted them. Use git reset --hard <commit-hash> to restore your project to that previous state. 3. Check for Untracked Files: After restoring the previous commit, check if there are any untracked files in your project directory using git status. If you find your lost code files among the untracked files, add them back to Git using git add. and commit the changes. Do this may be it's work for you.
Danix
DanixOP3d ago
can i show u the screen ?
Muhammad Hasnat
come in my ib msg i will guide you
Danix
DanixOP3d ago
u mean dm? .
Muhammad Hasnat
yes
Danix
DanixOP3d ago
yeh coming
dan1st
dan1st3d ago
@Muhammad Hasnat Please don't post ChatGPT answers here. Doing so is disrespectful towards askers. If someone wants to ask ChatGPT, they can
Muhammad Hasnat
it's paid version answers and 100% accurate so that's why i share at here otherwise i don't
dan1st
dan1st3d ago
No it isn't 100% accurate. And don't share stuff without other people asking for it. See #❗︱how-to-get-help (7).
Muhammad Hasnat
ok thanks for suggestion
dan1st
dan1st3d ago
What other commands did you use? Did you commit the files before? Are the files gone both locally and on GitHub?
Muhammad Hasnat
yes it says removed from both
dan1st
dan1st3d ago
You might be successful with the reflog. But before doing anything, please copy the entire directory (folder) with the .git and the files (so you have a backup of your current state in case you are executing commands causing git to remove dangling references) The interesting question is whether they were committed before (even if the commit was rewritten/removed)
Danix
DanixOP3d ago
yeh i committed the file before but i didnot reach to github bcz of my api key issue and suddenly got deleted from my local repo
dan1st
dan1st3d ago
Then you can likely recover it using the reflog First, make a backup of the entire project including the .git folder Once you have done that, type git reflog. That shows you the last commits and similar things you made (even if you overwrote these commits with something else). It should give you a list of commit hashes for each of the elements in that list, starting at the top one, type git checkout REF where REF is the element in that list. Check for the deleted files after executing each of these commands. if you feel unsure, show the output of the command.
Danix
DanixOP3d ago
It had given me only the first commit
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git reflog
41ca830 (HEAD -> main) HEAD@{0}: commit (initial): Initial commit for scriptenhancerapp
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git reflog
41ca830 (HEAD -> main) HEAD@{0}: commit (initial): Initial commit for scriptenhancerapp
dan1st
dan1st3d ago
Oh and also check git status first. Ensure there are no "untracked" or modified files Did you delete and re-clone the repository?
Danix
DanixOP3d ago
no
Danix
DanixOP3d ago
No description
Danix
DanixOP3d ago
this is how my project looks
dan1st
dan1st3d ago
and that's the full output? Did you maybe delete and recreate the .git folder? What is the output of git log and git status?
Danix
DanixOP3d ago
yeh i recreate this git folder for the parent folder
`PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> 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)
(commit or discard the untracked or modified content in submodules)
modified: ScriptEnhancerBackend (new commits, modified content, untracked content)

Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.project
.settings/
ScriptEnhancerFrontend/.gitignore
ScriptEnhancerFrontend/README.md
ScriptEnhancerFrontend/eslint.config.js
ScriptEnhancerFrontend/index.html
ScriptEnhancerFrontend/package-lock.json
ScriptEnhancerFrontend/package.json
ScriptEnhancerFrontend/postcss.config.js
ScriptEnhancerFrontend/public/
ScriptEnhancerFrontend/src/
ScriptEnhancerFrontend/tailwind.config.js
ScriptEnhancerFrontend/vite.config.js
how 9864b4a

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
`PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> 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)
(commit or discard the untracked or modified content in submodules)
modified: ScriptEnhancerBackend (new commits, modified content, untracked content)

Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.project
.settings/
ScriptEnhancerFrontend/.gitignore
ScriptEnhancerFrontend/README.md
ScriptEnhancerFrontend/eslint.config.js
ScriptEnhancerFrontend/index.html
ScriptEnhancerFrontend/package-lock.json
ScriptEnhancerFrontend/package.json
ScriptEnhancerFrontend/postcss.config.js
ScriptEnhancerFrontend/public/
ScriptEnhancerFrontend/src/
ScriptEnhancerFrontend/tailwind.config.js
ScriptEnhancerFrontend/vite.config.js
how 9864b4a

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
This is the output
dan1st
dan1st3d ago
and git log?
Danix
DanixOP3d ago
no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git log
commit 41ca8300af5fc0035760998b9e16a5daae016793 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:30:43 2025 +0530

Initial commit for scriptenhancerapp
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git log
commit 41ca8300af5fc0035760998b9e16a5daae016793 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:30:43 2025 +0530

Initial commit for scriptenhancerapp
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st3d ago
And you are sure the lost files were in that directory? It doesn't look like there's an application.properties supposed to be there
Danix
DanixOP3d ago
git rm --cached
git rm --cached
when i did this before my files code got vanished i was getting all the files in the whole project
dan1st
dan1st3d ago
What exactly did you run? and which files disappeared git rm --cached on its own doesn't delete any files
Danix
DanixOP3d ago
there is no file which has been lost the code of some files got lost and the api key from the app.properties as well
dan1st
dan1st3d ago
Can you show the ScriptEnhancerBackend directory?
Danix
DanixOP3d ago
Its like i got my previous code back instead of the lastest one ! yeh
dan1st
dan1st3d ago
I assume the lost files would be suppised to be there
Danix
DanixOP3d ago
No description
dan1st
dan1st3d ago
It would be good to know what you did except git rm --cached run git status and git reflog in that directory
Danix
DanixOP3d ago
let me git status :
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> cd C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git status
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: src/main/resources/application.properties

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: pom.xml
modified: src/main/java/com/scriptenhancer/JwtConfig/JwtUtil.java
modified: src/main/java/com/scriptenhancer/config/SecurityConfiguration.java
modified: src/main/java/com/scriptenhancer/controllers/AdminController.java
modified: src/main/java/com/scriptenhancer/controllers/SignUpAndLoginController.java
modified: src/main/java/com/scriptenhancer/entities/Role.java
modified: src/main/java/com/scriptenhancer/entities/User.java
modified: src/main/java/com/scriptenhancer/globalexception/RestGlobaladvice.java
modified: src/main/java/com/scriptenhancer/model/AuthRequest.java
modified: src/main/java/com/scriptenhancer/service/AdminService.java

Untracked files:
(use "git add <file>..." to include in what will be committed)
src/main/java/com/scriptenhancer/config/RestTemplateConfig.java
src/main/java/com/scriptenhancer/controllers/TextEnhancerController.java
src/main/java/com/scriptenhancer/customexceptions/NoInputAndOutputFound.java
src/main/java/com/scriptenhancer/entities/InputAndOutput.java
src/main/java/com/scriptenhancer/repository/InputAndOutputRepository.java
src/main/java/com/scriptenhancer/service/TextEnhancerService.java
src/main/resources/META-INF/
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> cd C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git status
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: src/main/resources/application.properties

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: pom.xml
modified: src/main/java/com/scriptenhancer/JwtConfig/JwtUtil.java
modified: src/main/java/com/scriptenhancer/config/SecurityConfiguration.java
modified: src/main/java/com/scriptenhancer/controllers/AdminController.java
modified: src/main/java/com/scriptenhancer/controllers/SignUpAndLoginController.java
modified: src/main/java/com/scriptenhancer/entities/Role.java
modified: src/main/java/com/scriptenhancer/entities/User.java
modified: src/main/java/com/scriptenhancer/globalexception/RestGlobaladvice.java
modified: src/main/java/com/scriptenhancer/model/AuthRequest.java
modified: src/main/java/com/scriptenhancer/service/AdminService.java

Untracked files:
(use "git add <file>..." to include in what will be committed)
src/main/java/com/scriptenhancer/config/RestTemplateConfig.java
src/main/java/com/scriptenhancer/controllers/TextEnhancerController.java
src/main/java/com/scriptenhancer/customexceptions/NoInputAndOutputFound.java
src/main/java/com/scriptenhancer/entities/InputAndOutput.java
src/main/java/com/scriptenhancer/repository/InputAndOutputRepository.java
src/main/java/com/scriptenhancer/service/TextEnhancerService.java
src/main/resources/META-INF/
dan1st
dan1st3d ago
Ah I see Eclipse files ❤️
Danix
DanixOP3d ago
this is the git log
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git log
commit e32676e323a6df6a0cc192055e58e818a041bee1 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 18:07:17 2025 +0530

Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:25:30 2025 +0530

Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git log
commit e32676e323a6df6a0cc192055e58e818a041bee1 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 18:07:17 2025 +0530

Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:25:30 2025 +0530

Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st3d ago
First of all,make a backup of the entire ScriptEnhancerApp directory
Danix
DanixOP3d ago
u mean copy and paste to another place ?
dan1st
dan1st3d ago
yes, copy the entire folder What is it with the changes there? What do you want to do with them?
Danix
DanixOP3d ago
what ?
dan1st
dan1st3d ago
When you said you lost files - are the contents gone/changed or are the entire files gone? git tells you these files are changed without git knowing about these changes untracked = aren't committed yet but exist on your computer modified = changed on your computer but the changes aren't committed
Danix
DanixOP3d ago
hm i copy and pasted the whole project
dan1st
dan1st3d ago
?
Danix
DanixOP3d ago
this is the repo of github in case u need it https://github.com/Deepak2250/scriptenhancerapp
GitHub
GitHub - Deepak2250/scriptenhancerapp
Contribute to Deepak2250/scriptenhancerapp development by creating an account on GitHub.
dan1st
dan1st3d ago
What did you copy paste from where to where?
Danix
DanixOP3d ago
like u said make a copy of the whole project
dan1st
dan1st3d ago
the thing is - if you check for lost files, the current untracked and modified files would kinda be gone Can you run git diff HEAD? That should show some modifications. Do you prefer having these modifications or not?
Danix
DanixOP3d ago
in which folder : parent or any sub folder
dan1st
dan1st3d ago
backend we do everything in backend now What exact files are missing?
Danix
DanixOP3d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git diff HEAD
warning: in the working copy of 'pom.xml', LF will be replaced by CRLF the next time Git touches it
diff --git a/pom.xml b/pom.xml
index 31c8469..9ab53e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,6 +107,10 @@
<version>1.4.11</version> <!-- Ensure to use the latest version -->
</dependency>

+<dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+</dependency>

:
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git diff HEAD
warning: in the working copy of 'pom.xml', LF will be replaced by CRLF the next time Git touches it
diff --git a/pom.xml b/pom.xml
index 31c8469..9ab53e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,6 +107,10 @@
<version>1.4.11</version> <!-- Ensure to use the latest version -->
</dependency>

+<dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+</dependency>

:
dan1st
dan1st3d ago
Did you make these changes there? You can use the space key to show more and q to exit And do you prefer having these changes or not?
Danix
DanixOP3d ago
in the service folder i have a class called text enhancer.java and the changes that i had made in it yesterday like some more methods are gone and it looks like the code is back to the previous versionn of itself and the modifications i had done in security config and in the controller of textenhancer some methods are also gone there that i had made yesterday !
dan1st
dan1st3d ago
What about the modifications that are shown in this command? Would you like them or not? actually we can just stash them and you can access them later
Danix
DanixOP3d ago
yeh sure
dan1st
dan1st3d ago
run the following commands:
git add .
git stash
git add .
git stash
that saves your current modifications (output of git diff) for later Then you check git status. That should be empty. If it is, run git reflog and show the output
Danix
DanixOP3d ago
wait i got the whole project that was around 10 days ago ! what the hell
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git add .
warning: in the working copy of 'pom.xml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/main/resources/META-INF/additional-spring-configuration-metadata.json', LF will be replaced by CRLF the next time Git touches it
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git stash
Saved working directory and index state WIP on main: e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git add .
warning: in the working copy of 'pom.xml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/main/resources/META-INF/additional-spring-configuration-metadata.json', LF will be replaced by CRLF the next time Git touches it
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git stash
Saved working directory and index state WIP on main: e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st3d ago
you want the state from yesterday and not 10d ago, right?
Danix
DanixOP3d ago
yeh
dan1st
dan1st3d ago
What does git status show?
Danix
DanixOP3d ago
nothing to commit
dan1st
dan1st3d ago
the whole thing or git log you probably need that the first line of git log
Danix
DanixOP3d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git log
commit e32676e323a6df6a0cc192055e58e818a041bee1 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 18:07:17 2025 +0530

Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:25:30 2025 +0530

Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git log
commit e32676e323a6df6a0cc192055e58e818a041bee1 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 18:07:17 2025 +0530

Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:25:30 2025 +0530

Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st3d ago
write down the first commit hash there the e326... If anything goes bad, running git checkout e32676e... followed by git stash apply gets you back to what you had today (before git stash). Don't do that right now Once you have written that down, run git reflog and show me the output
Danix
DanixOP3d ago
so first i need to make the git checkout then git reflog
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout e32676e323a6df6a0cc192055e58e818a041bee1
Note: switching to 'e32676e323a6df6a0cc192055e58e818a041bee1'.

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 branches 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 e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog
e32676e (HEAD, main) HEAD@{0}: checkout: moving from main to e32676e323a6df6a0cc192055e58e818a041bee1
e32676e (HEAD, main) HEAD@{1}: reset: moving to HEAD
e32676e (HEAD, main) HEAD@{2}: commit: Adding the backend initial code
6397435 HEAD@{3}: reset: moving to HEAD
6397435 HEAD@{4}: reset: moving to HEAD
6397435 HEAD@{5}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout e32676e323a6df6a0cc192055e58e818a041bee1
Note: switching to 'e32676e323a6df6a0cc192055e58e818a041bee1'.

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 branches 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 e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog
e32676e (HEAD, main) HEAD@{0}: checkout: moving from main to e32676e323a6df6a0cc192055e58e818a041bee1
e32676e (HEAD, main) HEAD@{1}: reset: moving to HEAD
e32676e (HEAD, main) HEAD@{2}: commit: Adding the backend initial code
6397435 HEAD@{3}: reset: moving to HEAD
6397435 HEAD@{4}: reset: moving to HEAD
6397435 HEAD@{5}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
are u there @dan1st | Daniel
dan1st
dan1st3d ago
yes but I had to fix something with @JavaBot
6397435 HEAD@{4}: reset: moving to HEAD
that doesn't look that good but we can try
Danix
DanixOP3d ago
can u please help bcz now it becomes even worse
dan1st
dan1st3d ago
so, you run
git checkout HEAD@{1}
git checkout HEAD@{1}
then you check for the lost files that's why I told you to make a backup and stash the changes - so you can get back if it doesn't work
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout HEAD@{1}
error: unknown switch `e'
usage: git checkout [<options>] <branch>
or: git checkout [<options>] [<branch>] -- <file>...

-b <branch> create and checkout a new branch
-B <branch> create/reset and checkout a branch
-l create reflog for new branch
--guess second guess 'git checkout <no-such-branch>' (default)
--overlay use overlay mode (default)
-q, --quiet suppress progress reporting
--recurse-submodules[=<checkout>]
control recursive updating of submodules
--progress force progress reporting
-m, --merge perform a 3-way merge with the new branch
--conflict <style> conflict style (merge, diff3, or zdiff3)
-d, --detach detach HEAD at named commit
-t, --track[=(direct|inherit)]
set branch tracking configuration
-f, --force force checkout (throw away local modifications)
--orphan <new-branch> new unparented branch
--overwrite-ignore update ignored files (default)
--ignore-other-worktrees
do not check if another worktree is holding the given ref
-2, --ours checkout our version for unmerged files
-3, --theirs checkout their version for unmerged files
-p, --patch select hunks interactively
--ignore-skip-worktree-bits
do not limit pathspecs to sparse entries only
--pathspec-from-file <file>
read pathspec from file
--pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout HEAD@{1}
error: unknown switch `e'
usage: git checkout [<options>] <branch>
or: git checkout [<options>] [<branch>] -- <file>...

-b <branch> create and checkout a new branch
-B <branch> create/reset and checkout a branch
-l create reflog for new branch
--guess second guess 'git checkout <no-such-branch>' (default)
--overlay use overlay mode (default)
-q, --quiet suppress progress reporting
--recurse-submodules[=<checkout>]
control recursive updating of submodules
--progress force progress reporting
-m, --merge perform a 3-way merge with the new branch
--conflict <style> conflict style (merge, diff3, or zdiff3)
-d, --detach detach HEAD at named commit
-t, --track[=(direct|inherit)]
set branch tracking configuration
-f, --force force checkout (throw away local modifications)
--orphan <new-branch> new unparented branch
--overwrite-ignore update ignored files (default)
--ignore-other-worktrees
do not check if another worktree is holding the given ref
-2, --ours checkout our version for unmerged files
-3, --theirs checkout their version for unmerged files
-p, --patch select hunks interactively
--ignore-skip-worktree-bits
do not limit pathspecs to sparse entries only
--pathspec-from-file <file>
read pathspec from file
--pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
Can you try git checkout "HEAD@{1}"? With double quotes like that
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout "HEAD@{1}"
HEAD is now at e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout "HEAD@{1}"
HEAD is now at e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
That one looks like you might have never committed the files you said are lost in which case git didn't record anything about these files now check for the files oh can you please enter the following commands and show me the output?
git reflog
git reflog main
git branch
git reflog
git reflog main
git branch
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog
e32676e (HEAD, main) HEAD@{0}: checkout: moving from main to e32676e323a6df6a0cc192055e58e818a041bee1
e32676e (HEAD, main) HEAD@{1}: reset: moving to HEAD
e32676e (HEAD, main) HEAD@{2}: commit: Adding the backend initial code
6397435 HEAD@{3}: reset: moving to HEAD
6397435 HEAD@{4}: reset: moving to HEAD
6397435 HEAD@{5}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog main
e32676e (HEAD, main) main@{0}: commit: Adding the backend initial code
6397435 main@{1}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git branch
* (HEAD detached at e32676e)
main
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog
e32676e (HEAD, main) HEAD@{0}: checkout: moving from main to e32676e323a6df6a0cc192055e58e818a041bee1
e32676e (HEAD, main) HEAD@{1}: reset: moving to HEAD
e32676e (HEAD, main) HEAD@{2}: commit: Adding the backend initial code
6397435 HEAD@{3}: reset: moving to HEAD
6397435 HEAD@{4}: reset: moving to HEAD
6397435 HEAD@{5}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog main
e32676e (HEAD, main) main@{0}: commit: Adding the backend initial code
6397435 main@{1}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git branch
* (HEAD detached at e32676e)
main
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
.
dan1st
dan1st2d ago
I assume you checked for the lost files and they aren't there? if yes, run
git checkout "HEAD@{2}"
git checkout "HEAD@{2}"
and check again
Danix
DanixOP2d ago
I already had made a backup of this project when u told me to do and now i can delete this project and can work on the backup porject but i need your help in that too aswell bcz i am not able to push my code to github
dan1st
dan1st2d ago
you might still be able to recover it with these commands or similar
Danix
DanixOP2d ago
like the yesterday's code as well ?
dan1st
dan1st2d ago
possibly
Danix
DanixOP2d ago
so can i make another backup of the backup project and try it in it and can recover the yesterdays code !
Danix
DanixOP2d ago
this is the current folder
No description
Danix
DanixOP2d ago
with all the class and code expect the methods and code which were vanished before
dan1st
dan1st2d ago
After doing that, yesterday's code was still not here, right?
Danix
DanixOP2d ago
yeh
dan1st
dan1st2d ago
then, run
git checkout "HEAD@{2}"
git checkout "HEAD@{2}"
in the backend directory
Danix
DanixOP2d ago
but now we have the backup project
dan1st
dan1st2d ago
and check again we first check for yesterday's code
Danix
DanixOP2d ago
no i cant bcz i deleted the bad project
dan1st
dan1st2d ago
Why????
Danix
DanixOP2d ago
now we have to work with these project the backup
dan1st
dan1st2d ago
now you need a copy of the backup (not the actual backup) and do the same things again and don't delete stuff the whole point was going back to see what information git has about the past
Danix
DanixOP2d ago
so what to do now for this backup
dan1st
dan1st2d ago
create a copy of the backup don't change anything within the backup
Danix
DanixOP2d ago
ok done ok now
dan1st
dan1st2d ago
so in the copy of the backup, you have a ScriptEnhancerBackend directory
Danix
DanixOP2d ago
yeh
dan1st
dan1st2d ago
there, you again run the following commands
git status
git reflog --all
git status
git reflog --all
Danix
DanixOP2d ago
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: src/main/resources/application.properties

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: pom.xml
modified: src/main/java/com/scriptenhancer/JwtConfig/JwtUtil.java
modified: src/main/java/com/scriptenhancer/config/SecurityConfiguration.java
modified: src/main/java/com/scriptenhancer/controllers/AdminController.java
modified: src/main/java/com/scriptenhancer/controllers/SignUpAndLoginController.java
modified: src/main/java/com/scriptenhancer/entities/Role.java
modified: src/main/java/com/scriptenhancer/entities/User.java
modified: src/main/java/com/scriptenhancer/globalexception/RestGlobaladvice.java
modified: src/main/java/com/scriptenhancer/model/AuthRequest.java
modified: src/main/java/com/scriptenhancer/service/AdminService.java

Untracked files:
(use "git add <file>..." to include in what will be committed)
src/main/java/com/scriptenhancer/config/RestTemplateConfig.java
src/main/java/com/scriptenhancer/controllers/TextEnhancerController.java
src/main/java/com/scriptenhancer/customexceptions/NoInputAndOutputFound.java
src/main/java/com/scriptenhancer/entities/InputAndOutput.java
src/main/java/com/scriptenhancer/repository/InputAndOutputRepository.java
src/main/java/com/scriptenhancer/service/TextEnhancerService.java
src/main/resources/META-INF/

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: src/main/resources/application.properties

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: pom.xml
modified: src/main/java/com/scriptenhancer/JwtConfig/JwtUtil.java
modified: src/main/java/com/scriptenhancer/config/SecurityConfiguration.java
modified: src/main/java/com/scriptenhancer/controllers/AdminController.java
modified: src/main/java/com/scriptenhancer/controllers/SignUpAndLoginController.java
modified: src/main/java/com/scriptenhancer/entities/Role.java
modified: src/main/java/com/scriptenhancer/entities/User.java
modified: src/main/java/com/scriptenhancer/globalexception/RestGlobaladvice.java
modified: src/main/java/com/scriptenhancer/model/AuthRequest.java
modified: src/main/java/com/scriptenhancer/service/AdminService.java

Untracked files:
(use "git add <file>..." to include in what will be committed)
src/main/java/com/scriptenhancer/config/RestTemplateConfig.java
src/main/java/com/scriptenhancer/controllers/TextEnhancerController.java
src/main/java/com/scriptenhancer/customexceptions/NoInputAndOutputFound.java
src/main/java/com/scriptenhancer/entities/InputAndOutput.java
src/main/java/com/scriptenhancer/repository/InputAndOutputRepository.java
src/main/java/com/scriptenhancer/service/TextEnhancerService.java
src/main/resources/META-INF/

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog --all
e32676e (HEAD -> main) refs/heads/main@{0}: commit: Adding the backend initial code
e32676e (HEAD -> main) HEAD@{0}: commit: Adding the backend initial code
6397435 HEAD@{1}: reset: moving to HEAD
6397435 HEAD@{2}: reset: moving to HEAD
6397435 refs/heads/main@{1}: commit (initial): Added the first code of backend
6397435 HEAD@{3}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog --all
e32676e (HEAD -> main) refs/heads/main@{0}: commit: Adding the backend initial code
e32676e (HEAD -> main) HEAD@{0}: commit: Adding the backend initial code
6397435 HEAD@{1}: reset: moving to HEAD
6397435 HEAD@{2}: reset: moving to HEAD
6397435 refs/heads/main@{1}: commit (initial): Added the first code of backend
6397435 HEAD@{3}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
ok so you first run
git add .
git stash
git add .
git stash
This gets you back to 10 days ago and that's intended and then you run git status and git reflog --all again
Danix
DanixOP2d ago
git status
On branch main
nothing to commit, working tree clean
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
git status
On branch main
nothing to commit, working tree clean
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog --all
8488904 (refs/stash) refs/stash@{0}: WIP on main: e32676e Adding the backend initial code
e32676e (HEAD -> main) HEAD@{0}: reset: moving to HEAD
e32676e (HEAD -> main) refs/heads/main@{0}: commit: Adding the backend initial code
e32676e (HEAD -> main) HEAD@{1}: commit: Adding the backend initial code
6397435 HEAD@{2}: reset: moving to HEAD
6397435 HEAD@{3}: reset: moving to HEAD
6397435 refs/heads/main@{1}: commit (initial): Added the first code of backend
6397435 HEAD@{4}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git reflog --all
8488904 (refs/stash) refs/stash@{0}: WIP on main: e32676e Adding the backend initial code
e32676e (HEAD -> main) HEAD@{0}: reset: moving to HEAD
e32676e (HEAD -> main) refs/heads/main@{0}: commit: Adding the backend initial code
e32676e (HEAD -> main) HEAD@{1}: commit: Adding the backend initial code
6397435 HEAD@{2}: reset: moving to HEAD
6397435 HEAD@{3}: reset: moving to HEAD
6397435 refs/heads/main@{1}: commit (initial): Added the first code of backend
6397435 HEAD@{4}: commit (initial): Added the first code of backend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
ok done
dan1st
dan1st2d ago
Good. Then you run the following:
git checkout HEAD@{0}
git checkout HEAD@{0}
then you check for the lost files my fault, it should be
git checkout "HEAD@{0}"
git checkout "HEAD@{0}"
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout "HEAD@{0}"
Note: switching to 'HEAD@{0}'.

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 branches 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 e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout "HEAD@{0}"
Note: switching to 'HEAD@{0}'.

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 branches 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 e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
now check for the lost files
Danix
DanixOP2d ago
i cant see any files !
dan1st
dan1st2d ago
?
Danix
DanixOP2d ago
as u said look for the lost files ! There is no file here in the output from the command
dan1st
dan1st2d ago
Not in the command in explorer
Danix
DanixOP2d ago
I said u before that there are no files that had been lost ! Some code from the files like the controller , service that i had made yesterday is lost .
dan1st
dan1st2d ago
I don't expect any files in the command then you can run
git checkout "refs/heads/main@{0}"
git checkout "refs/heads/main@{0}"
and check again
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout "refs/heads/main@{0}"
HEAD is now at e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git checkout "refs/heads/main@{0}"
HEAD is now at e32676e Adding the backend initial code
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
now check the files in explorer
Danix
DanixOP2d ago
same as before
dan1st
dan1st2d ago
Then
git checkout "HEAD@{1}"
git checkout "HEAD@{1}"
and check again - it might still be the same as before but please still check
Danix
DanixOP2d ago
nahh same even i checked the 2 or 3 as well
dan1st
dan1st2d ago
then
git checkout "HEAD@{2}"
git checkout "HEAD@{2}"
Danix
DanixOP2d ago
same
dan1st
dan1st2d ago
100% exact same?
Danix
DanixOP2d ago
yeh
dan1st
dan1st2d ago
then you should be able to get back with
git checkout e32676e
git stash apply
git checkout e32676e
git stash apply
then you should have the state you had earlier today But from what you have shown, you have either deleted the git repository in some way or you executed commands other than git rm --cached please check that
Danix
DanixOP2d ago
git rm -r --cached .
git rm -r --cached .
i even did this
git restore .
git restore .
git restore --staged .
git restore --staged .
git reset --soft HEAD~1
git reset --soft HEAD~1
rm -rf path/to/folder_or_file
rm -rf path/to/folder_or_file
dan1st
dan1st2d ago
that one actually removes stuff without you being able to recover it if you haven't committed it before
Danix
DanixOP2d ago
these are the commits i did before is there any way to recover it now ?
dan1st
dan1st2d ago
and that can also result in you losing data if you haven't committed it, you cannot recover it
Danix
DanixOP2d ago
oh felt bad for me
dan1st
dan1st2d ago
src/main/resources/application.properties is one of the lost files, right? There is one thing you could try but if you have never committed it, it wouldn't help much
Danix
DanixOP2d ago
it is not lost the api key that i had set in it is lost what
dan1st
dan1st2d ago
You first need to know the exact path of one of the lost files and then you can tell git to search for it
Danix
DanixOP2d ago
how ?
dan1st
dan1st2d ago
Do you have such a path?
git log --reflog --all --remotes -- src/main/resources/application.properties
git log --reflog --all --remotes -- src/main/resources/application.properties
for example
Danix
DanixOP2d ago
i didnot get it ? .
dan1st
dan1st2d ago
? You first need to know the exact path of one of the lost files but it likely doesn't find anything
Danix
DanixOP2d ago
ScriptEnhancerBackend\src\main\resources\application.properties
ScriptEnhancerBackend\src\main\resources\application.properties
like this one
dan1st
dan1st2d ago
then you can try executing
git log --reflog --all --remotes -- src\main\resources\application.properties
git log --reflog --all --remotes -- src\main\resources\application.properties
inside ScriptEnhancerBackend and also
git log --reflog --all --remotes -- ScriptEnhancerBackend\src\main\resources\application.properties
git log --reflog --all --remotes -- ScriptEnhancerBackend\src\main\resources\application.properties
outside of it
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git log --reflog --all --remotes -- C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend\src\main\resources\application.properties
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code
:...skipping...
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
Author: Deepak <[email protected]>
:...skipping...
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:25:30 2025 +0530
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git log --reflog --all --remotes -- C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend\src\main\resources\application.properties
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code
:...skipping...
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
Author: Deepak <[email protected]>
:...skipping...
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

commit 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:25:30 2025 +0530
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
oh run
git show 314a063d85ea35e5258f9ce33652b268ddaede27
git show 314a063d85ea35e5258f9ce33652b268ddaede27
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git show 314a063d85ea35e5258f9ce33652b268ddaede27
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

diff --git a/pom.xml b/pom.xml
index 31c8469..9ab53e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,6 +107,10 @@
<version>1.4.11</version> <!-- Ensure to use the latest version -->
</dependency>

+<dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+</dependency>

</dependencies>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git show 314a063d85ea35e5258f9ce33652b268ddaede27
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

diff --git a/pom.xml b/pom.xml
index 31c8469..9ab53e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,6 +107,10 @@
<version>1.4.11</version> <!-- Ensure to use the latest version -->
</dependency>

+<dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+</dependency>

</dependencies>
dan1st
dan1st2d ago
Did the state from 10 days ago have an application.properties?
Danix
DanixOP2d ago
yeh
dan1st
dan1st2d ago
I see try running
git show 314a063d85ea35e5258f9ce33652b268ddaede27 ScriptEnhancerBackend\src\main\resources\application.properties
git show 314a063d85ea35e5258f9ce33652b268ddaede27 ScriptEnhancerBackend\src\main\resources\application.properties
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git show 314a063d85ea35e5258f9ce33652b268ddaede27 C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

diff --git a/pom.xml b/pom.xml
index 31c8469..9ab53e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,6 +107,10 @@
<version>1.4.11</version> <!-- Ensure to use the latest version -->
</dependency>

+<dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+</dependency>

</dependencies>
:
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git show 314a063d85ea35e5258f9ce33652b268ddaede27 C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

diff --git a/pom.xml b/pom.xml
index 31c8469..9ab53e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,6 +107,10 @@
<version>1.4.11</version> <!-- Ensure to use the latest version -->
</dependency>

+<dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+</dependency>

</dependencies>
:
dan1st
dan1st2d ago
not the whole path with C: just
git show 314a063d85ea35e5258f9ce33652b268ddaede27 src\main\resources\application.properties
git show 314a063d85ea35e5258f9ce33652b268ddaede27 src\main\resources\application.properties
to specifically check the application.properties changes
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git show 314a063d85ea35e5258f9ce33652b268ddaede27 src\main\resources\application.properties
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 742b0c7..317e033 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -22,3 +22,5 @@ logging.level.com.scriptenhancer=DEBUG
# logging.level.com.scriptenhancer.service.UserDetailsServicImp=DEBUG
# logging.level.com.scriptenhancer.controllers.SignUpAndLoginController = DEBUG

+
+
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git show 314a063d85ea35e5258f9ce33652b268ddaede27 src\main\resources\application.properties
commit 314a063d85ea35e5258f9ce33652b268ddaede27
Author: Deepak <[email protected]>
Date: Tue Jan 28 14:24:32 2025 +0530

index on main: e32676e Adding the backend initial code

diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 742b0c7..317e033 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -22,3 +22,5 @@ logging.level.com.scriptenhancer=DEBUG
# logging.level.com.scriptenhancer.service.UserDetailsServicImp=DEBUG
# logging.level.com.scriptenhancer.controllers.SignUpAndLoginController = DEBUG

+
+
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
that doesn't seem like a very useful change you could also try
git show 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec src\main\resources\application.properties
git show 6397435ae1ba59a0f16eb6459dd1f7cefcacc8ec src\main\resources\application.properties
but ig it doesn't show you much either
Danix
DanixOP2d ago
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
new file mode 100644
index 0000000..742b0c7
--- /dev/null
+++ b/src/main/resources/application.properties
@@ -0,0 +1,24 @@
+spring.application.name=ScriptEnhancer
+
+# Database Configuration
+spring.datasource.url=jdbc:mysql://127.0.0.1:3306/scriptenhancer
+spring.datasource.username=root
+spring.datasource.password=
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
new file mode 100644
index 0000000..742b0c7
--- /dev/null
+++ b/src/main/resources/application.properties
@@ -0,0 +1,24 @@
+spring.application.name=ScriptEnhancer
+
+# Database Configuration
+spring.datasource.url=jdbc:mysql://127.0.0.1:3306/scriptenhancer
+spring.datasource.username=root
+spring.datasource.password=
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
ig that's the original file without any of the changes you want like the state of 10 days ago?
Danix
DanixOP2d ago
listen ig the lost is recoverable by me manually so just tell me : So as you had watched my git hub and any local project strcture so what should i have to do to push the rest of the code to the GitHub bcz before i was getting issue ! for ex: i want the whole backend folder to be committed and pushed so what to do ? without the app.properties inside it .. bcz i had lost my file just while doing push the code to github
dan1st
dan1st2d ago
ok so currently you have multiple .git directories - one in the project root and one in the backend directory You want to push the files you have right now, right?
Danix
DanixOP2d ago
Yeh
dan1st
dan1st2d ago
then you can delete the .git directory in ScriptEnhancerBackend (again, make sure you have a backup) and then you can git add and git commit the files but if you have nested .git directories, you cannot push the inner one pretty much (it's a bit more complicated than that - git would assume these are different repositories)
Danix
DanixOP2d ago
ok now i had deleted the .git from the basckend folder so should i have to go to the parent folder to git add ?
dan1st
dan1st2d ago
yes you can do git add . and git status there - it should then show you the changes it wants to commit make sure these don't contain anything you don't want to commit (if there is a token somewhere, don't commit it)
Danix
DanixOP2d ago
git add C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend
git add C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend
i am doing this
dan1st
dan1st2d ago
you can just do git add ScriptEnhancerBackend but ig your command works as well
Danix
DanixOP2d ago
this is an issue ?
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> cd..
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git add ScriptEnhancerBackend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch main
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.project
.settings/
ScriptEnhancerFrontend/.gitignore
ScriptEnhancerFrontend/README.md
ScriptEnhancerFrontend/eslint.config.js
ScriptEnhancerFrontend/index.html
ScriptEnhancerFrontend/package-lock.json
ScriptEnhancerFrontend/package.json
ScriptEnhancerFrontend/postcss.config.js
ScriptEnhancerFrontend/public/
ScriptEnhancerFrontend/src/
ScriptEnhancerFrontend/tailwind.config.js
ScriptEnhancerFrontend/vite.config.js
how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> cd..
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git add ScriptEnhancerBackend
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch main
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.project
.settings/
ScriptEnhancerFrontend/.gitignore
ScriptEnhancerFrontend/README.md
ScriptEnhancerFrontend/eslint.config.js
ScriptEnhancerFrontend/index.html
ScriptEnhancerFrontend/package-lock.json
ScriptEnhancerFrontend/package.json
ScriptEnhancerFrontend/postcss.config.js
ScriptEnhancerFrontend/public/
ScriptEnhancerFrontend/src/
ScriptEnhancerFrontend/tailwind.config.js
ScriptEnhancerFrontend/vite.config.js
how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
Can you show your .gitignore? Does your ScriptEnhancerBackend really contain stuff you want to commit and not have its own .git folder?
Danix
DanixOP2d ago
the backend folder gitignore :
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
parent folder gitignore : is empty
dan1st
dan1st2d ago
Do you have a .git folder in ScriptEnhancerBackend?
Danix
DanixOP2d ago
no
Danix
DanixOP2d ago
No description
dan1st
dan1st2d ago
What is the output of git status in ScriptEnhancerBackend? Does it really contain the files you want to commit? like the files from earlier today
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git status
On branch main
Untracked files:
(use "git add <file>..." to include in what will be committed)
../.gitignore
../.project
../.settings/
../ScriptEnhancerFrontend/.gitignore
../ScriptEnhancerFrontend/README.md
../ScriptEnhancerFrontend/eslint.config.js
../ScriptEnhancerFrontend/index.html
../ScriptEnhancerFrontend/package-lock.json
../ScriptEnhancerFrontend/package.json
../ScriptEnhancerFrontend/postcss.config.js
../ScriptEnhancerFrontend/public/
../ScriptEnhancerFrontend/src/
../ScriptEnhancerFrontend/tailwind.config.js
../ScriptEnhancerFrontend/vite.config.js
../how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git status
On branch main
Untracked files:
(use "git add <file>..." to include in what will be committed)
../.gitignore
../.project
../.settings/
../ScriptEnhancerFrontend/.gitignore
../ScriptEnhancerFrontend/README.md
../ScriptEnhancerFrontend/eslint.config.js
../ScriptEnhancerFrontend/index.html
../ScriptEnhancerFrontend/package-lock.json
../ScriptEnhancerFrontend/package.json
../ScriptEnhancerFrontend/postcss.config.js
../ScriptEnhancerFrontend/public/
../ScriptEnhancerFrontend/src/
../ScriptEnhancerFrontend/tailwind.config.js
../ScriptEnhancerFrontend/vite.config.js
../how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
it seems all files you have there currently are already committed What's the output of git log?
Danix
DanixOP2d ago
in backend?
dan1st
dan1st2d ago
doesn't matter but I'd do it in the root directory
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git log
commit 41ca8300af5fc0035760998b9e16a5daae016793 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:30:43 2025 +0530

Initial commit for scriptenhancerapp
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git log
commit 41ca8300af5fc0035760998b9e16a5daae016793 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:30:43 2025 +0530

Initial commit for scriptenhancerapp
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git log
commit 41ca8300af5fc0035760998b9e16a5daae016793 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:30:43 2025 +0530

Initial commit for scriptenhancerapp
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git log
commit 41ca8300af5fc0035760998b9e16a5daae016793 (HEAD -> main)
Author: Deepak <[email protected]>
Date: Tue Jan 21 17:30:43 2025 +0530

Initial commit for scriptenhancerapp
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
it seems like you currently have the state from Jan 21 and not the state from earlier today as you have said
Danix
DanixOP2d ago
hm
dan1st
dan1st2d ago
I literally asked you that multiple times so ig just make a copy of the backup again
Danix
DanixOP2d ago
yeh
dan1st
dan1st2d ago
and in that copy of the backup (again, don't touch anything with the backup), remove the .git folder inside the ScriptEnhancerBackend and run git status
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git status
On branch main
Untracked files:
(use "git add <file>..." to include in what will be committed)
../.gitignore
../.project
../.settings/
../ScriptEnhancerFrontend/.gitignore
../ScriptEnhancerFrontend/README.md
../ScriptEnhancerFrontend/eslint.config.js
../ScriptEnhancerFrontend/index.html
../ScriptEnhancerFrontend/package-lock.json
../ScriptEnhancerFrontend/package.json
../ScriptEnhancerFrontend/postcss.config.js
../ScriptEnhancerFrontend/public/
../ScriptEnhancerFrontend/src/
../ScriptEnhancerFrontend/tailwind.config.js
../ScriptEnhancerFrontend/vite.config.js
../how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend> git status
On branch main
Untracked files:
(use "git add <file>..." to include in what will be committed)
../.gitignore
../.project
../.settings/
../ScriptEnhancerFrontend/.gitignore
../ScriptEnhancerFrontend/README.md
../ScriptEnhancerFrontend/eslint.config.js
../ScriptEnhancerFrontend/index.html
../ScriptEnhancerFrontend/package-lock.json
../ScriptEnhancerFrontend/package.json
../ScriptEnhancerFrontend/postcss.config.js
../ScriptEnhancerFrontend/public/
../ScriptEnhancerFrontend/src/
../ScriptEnhancerFrontend/tailwind.config.js
../ScriptEnhancerFrontend/vite.config.js
../how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp\ScriptEnhancerBackend>
dan1st
dan1st2d ago
What's the output of git remote?
Danix
DanixOP2d ago
in the backend its : origin same with the parent
dan1st
dan1st2d ago
What happens when running git push origin main? it seems like all changes you have locally are already committed
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git push origin main
To https://github.com/Deepak2250/scriptenhancerapp.git
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/Deepak2250/scriptenhancerapp.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git push origin main
To https://github.com/Deepak2250/scriptenhancerapp.git
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/Deepak2250/scriptenhancerapp.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
Run the following commands
git checkout -b test
git push -u origin test
git checkout -b test
git push -u origin test
this creates a new branch with your current state and pushes that so you would then have a main and test branch on GitHub you can use to investigate and choose what you prefer
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git checkout -b test
Switched to a new branch 'test'
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git push -u origin test
Enumerating objects: 25, done.
Counting objects: 100% (25/25), done.
Delta compression using up to 8 threads
Compressing objects: 100% (21/21), done.
Writing objects: 100% (25/25), 165.37 KiB | 7.19 MiB/s, done.
Total 25 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Create a pull request for 'test' on GitHub by visiting:
remote: https://github.com/Deepak2250/scriptenhancerapp/pull/new/test
remote:
To https://github.com/Deepak2250/scriptenhancerapp.git
* [new branch] test -> test
branch 'test' set up to track 'origin/test'.
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git checkout -b test
Switched to a new branch 'test'
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git push -u origin test
Enumerating objects: 25, done.
Counting objects: 100% (25/25), done.
Delta compression using up to 8 threads
Compressing objects: 100% (21/21), done.
Writing objects: 100% (25/25), 165.37 KiB | 7.19 MiB/s, done.
Total 25 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Create a pull request for 'test' on GitHub by visiting:
remote: https://github.com/Deepak2250/scriptenhancerapp/pull/new/test
remote:
To https://github.com/Deepak2250/scriptenhancerapp.git
* [new branch] test -> test
branch 'test' set up to track 'origin/test'.
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
ok now how to integrate with the main and the test
dan1st
dan1st2d ago
oh ok Can you try running the following commands in the root?
git rm --cached ScriptEnhancerBackend
git add ScriptEnhancerBackend
git rm --cached ScriptEnhancerBackend
git add ScriptEnhancerBackend
i.e. run the commands in ScriptEnhancerApp and then git status Also do you have a .gitattributes file?
Danix
DanixOP2d ago
Danix
DanixOP2d ago
in backend and frontend folder yes
dan1st
dan1st2d ago
ok now that one looks good now you can commit and push that
Danix
DanixOP2d ago
Danix
DanixOP2d ago
it think here is the issue
dan1st
dan1st2d ago
git push origin test you are on the test branch because I didn't want you overwriting the main branch for now
Danix
DanixOP2d ago
done
dan1st
dan1st2d ago
GitHub
GitHub - Deepak2250/scriptenhancerapp at test
Contribute to Deepak2250/scriptenhancerapp development by creating an account on GitHub.
Danix
DanixOP2d ago
yeh if we only talk about the backend
dan1st
dan1st2d ago
?
Danix
DanixOP2d ago
i mean we only pushed the backend folder not the frontend one
dan1st
dan1st2d ago
What is the output of git status?
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.project
.settings/
ScriptEnhancerFrontend/.gitignore
ScriptEnhancerFrontend/README.md
ScriptEnhancerFrontend/eslint.config.js
ScriptEnhancerFrontend/index.html
ScriptEnhancerFrontend/package-lock.json
ScriptEnhancerFrontend/package.json
ScriptEnhancerFrontend/postcss.config.js
ScriptEnhancerFrontend/public/
ScriptEnhancerFrontend/src/
ScriptEnhancerFrontend/tailwind.config.js
ScriptEnhancerFrontend/vite.config.js
how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.project
.settings/
ScriptEnhancerFrontend/.gitignore
ScriptEnhancerFrontend/README.md
ScriptEnhancerFrontend/eslint.config.js
ScriptEnhancerFrontend/index.html
ScriptEnhancerFrontend/package-lock.json
ScriptEnhancerFrontend/package.json
ScriptEnhancerFrontend/postcss.config.js
ScriptEnhancerFrontend/public/
ScriptEnhancerFrontend/src/
ScriptEnhancerFrontend/tailwind.config.js
ScriptEnhancerFrontend/vite.config.js
how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
you can add and commit them as well
Danix
DanixOP2d ago
ok but for now what to do ?
dan1st
dan1st2d ago
? If you want to commit the frontend, do it
Danix
DanixOP2d ago
ok i pushed it to the test branch and now how to integrate with the main ?
dan1st
dan1st2d ago
Does the test branch have everything as you want it to?
Danix
DanixOP2d ago
dan1st
dan1st2d ago
I think you have both a ScriptEnhancerFrontend directory and that also has a ScriptEnhancerFrontend inside it
Danix
DanixOP2d ago
the frontend have multiple folders of frontend
dan1st
dan1st2d ago
Is the test branch looking perfectly as it should?
Danix
DanixOP2d ago
yehh i dont know how it comes should in have to delete it ? the one with no code or less code
dan1st
dan1st2d ago
if you don't want it, delete the inner one, add the change to git, commit and push it
Danix
DanixOP2d ago
and also want to remove it from the remote branch test
dan1st
dan1st2d ago
assuming you want to get rid of the inner one yes
Danix
DanixOP2d ago
ok so now the test have everything i want but i dont want the app.properties
dan1st
dan1st2d ago
then you run git rm --cached ScriptEnhancerBackend/src/main/resources/application.properties and after that, you add ScriptEnhancerBackend/src/main/resources/application.properties to the .gitignore of scriptenhancerapp then run git status
Danix
DanixOP2d ago
after git rm --cached ScriptEnhancerBackend/src/main/resources/application.properties should i have to push the chanhe to guithub or not ?
dan1st
dan1st2d ago
first check git status
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: ScriptEnhancerBackend/src/main/resources/application.properties

Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.project
.settings/
ScriptEnhancerBackend/src/main/resources/application.properties
how 9864b4a

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: ScriptEnhancerBackend/src/main/resources/application.properties

Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.project
.settings/
ScriptEnhancerBackend/src/main/resources/application.properties
how 9864b4a

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
add ScriptEnhancerBackend/src/main/resources/application.properties to the .gitignore
Danix
DanixOP2d ago
manually ?
dan1st
dan1st2d ago
also I think you probably want to add .project and .settings to the gitignore
ayylmao123xdd
ayylmao123xdd2d ago
o mamma mia is this thread gonna have the most messages in java help
dan1st
dan1st2d ago
yes
ayylmao123xdd
ayylmao123xdd2d ago
😱
dan1st
dan1st2d ago
I think we had more in the past
ayylmao123xdd
ayylmao123xdd2d ago
perhaps whats such a big problem with ignoring the secret key btw
Danix
DanixOP2d ago
ok done
ayylmao123xdd
ayylmao123xdd2d ago
did u delete some commit
Danix
DanixOP2d ago
git add .gitignore?
dan1st
dan1st2d ago
git status? the issues that happened afterwards
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: .gitignore
deleted: ScriptEnhancerBackend/src/main/resources/application.properties

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/
ScriptEnhancerBackend/src/main/resources/application.properties
how 9864b4a

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: .gitignore
deleted: ScriptEnhancerBackend/src/main/resources/application.properties

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/
ScriptEnhancerBackend/src/main/resources/application.properties
how 9864b4a

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
' should i push it ?
dan1st
dan1st2d ago
looks good - you can commit and git push actually there is something a bit weird can you show your .gitignore?
Danix
DanixOP2d ago
# Ignore application.properties file
ScriptEnhancerBackend/src/main/resources/application.properties

# Ignore Eclipse project settings
.project
.settings/
# Ignore application.properties file
ScriptEnhancerBackend/src/main/resources/application.properties

# Ignore Eclipse project settings
.project
.settings/
dan1st
dan1st2d ago
Can you show the .gitignore in ScriptEnhancerBackend?
Danix
DanixOP2d ago
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
dan1st
dan1st2d ago
idk why ScriptEnhancerBackend/src/main/resources/application.properties is shown as untracked you could also try to add the application.properties to the .gitignore of ScriptEnhancerBackend
Danix
DanixOP2d ago
yeh did it
dan1st
dan1st2d ago
Output of git status?
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

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: ScriptEnhancerBackend/.gitignore

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/
ScriptEnhancerBackend/src/main/resources/application.properties
how 9864b4a

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

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: ScriptEnhancerBackend/.gitignore

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/
ScriptEnhancerBackend/src/main/resources/application.properties
how 9864b4a

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
Can you show that file?
Danix
DanixOP2d ago
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

ScriptEnhancerBackend\src\main\resources\application.properties
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

ScriptEnhancerBackend\src\main\resources\application.properties
dan1st
dan1st2d ago
without the ScriptEnhancerBackend there and also use forward slashes and not backslashes
Danix
DanixOP2d ago
/src/main/resources/application.properties
/src/main/resources/application.properties
?
dan1st
dan1st2d ago
the leading slash isn't necessary but yes and then check git status again
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

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: ScriptEnhancerBackend/.gitignore

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/
how 9864b4a

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

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: ScriptEnhancerBackend/.gitignore

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/
how 9864b4a

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
perfect you can add the gitignore, commit and push
Danix
DanixOP2d ago
from parent right ?
dan1st
dan1st2d ago
both work form parent, it's git add ScriptEnhancerBackend, from ScriptEnhancerBackend it's git add .
Danix
DanixOP2d ago
Danix
DanixOP2d ago
issue
dan1st
dan1st2d ago
oh I think you added the .project and .settings directories run the following commands once
git reset --soft HEAD~
git restore --staged .
git reset --soft HEAD~
git restore --staged .
Danix
DanixOP2d ago
ok done
dan1st
dan1st2d ago
git status
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/
how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/
how 9864b4a

nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
ok now you're safe again the issue is that the gitignore doesn't seem to work properly Do you have a "how 9864b4a:15" file?
Danix
DanixOP2d ago
again ? how
dan1st
dan1st2d ago
the commands removed the commit causing the error without touching your files
Danix
DanixOP2d ago
yeh idk how it comes
dan1st
dan1st2d ago
but committing again might reintroduce the error Do you need it?
Danix
DanixOP2d ago
no
dan1st
dan1st2d ago
then delete it
Danix
DanixOP2d ago
vooooooo 1 sec i got my api key here
dan1st
dan1st2d ago
that file contains the token preventing you from pushing, yes alternatively you can rename it to token.txt or something similar and then add that to the .gitignore
Danix
DanixOP2d ago
can i add my api key to the app.properties ? and gitignore it ?
dan1st
dan1st2d ago
the application.properties is already in the gitignore
Danix
DanixOP2d ago
yeh sorry
dan1st
dan1st2d ago
so yes just add it there and then you can also delete that "how" file
Danix
DanixOP2d ago
ok delete it
dan1st
dan1st2d ago
git status?
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

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: ScriptEnhancerBackend/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

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: ScriptEnhancerBackend/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
ok so the ScriptEnhancerBackend/src/main/resources/META-INF/additional-spring-configuration-metadata.json contains a change
Danix
DanixOP2d ago
yeh
dan1st
dan1st2d ago
you can use git diff ScriptEnhancerBackend to view that change Do you want to commit it?
Danix
DanixOP2d ago
yeh
dan1st
dan1st2d ago
then you can do so Can you enter git rm --cached .project? Does that do anything? and does it change git status?
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git rm --cached .project
rm '.project'
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: .project

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git rm --cached .project
rm '.project'
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: .project

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
oh I think you just accidentially added .project and .settings it seems like the .gitignore doesn't work for these you can try adding /.project to the gitignore maybe Do you have a file index/exclude in your .git directory? or info/exclude
Danix
DanixOP2d ago
yeh
dan1st
dan1st2d ago
Can you show its contents?
Danix
DanixOP2d ago
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
dan1st
dan1st2d ago
ok Can you try that?
Danix
DanixOP2d ago
same as before git is not getting it !
dan1st
dan1st2d ago
git status still showing the file as untracked?
Danix
DanixOP2d ago
up to date
dan1st
dan1st2d ago
?
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

nothing to commit, working tree clean
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

nothing to commit, working tree clean
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
Can you run git rm --cached .project and git rm -r --cached .settings? and git status again
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git rm --cached .project
rm '.project'
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: .project

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git rm --cached .project
rm '.project'
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: .project

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
Can you show your .gitignore again? Did you add /.project and /.settings there?
Danix
DanixOP2d ago
# Ignore application.properties file
ScriptEnhancerBackend/src/main/resources/application.properties

# Ignore Eclipse project settings
/.project
/.settings
# Ignore application.properties file
ScriptEnhancerBackend/src/main/resources/application.properties

# Ignore Eclipse project settings
/.project
/.settings
dan1st
dan1st2d ago
Can you run git rm --cached .settings and show git status again? For some reason it seems like git is ignoring that .gitignore file
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: .project
deleted: .settings/.jsdtscope
deleted: .settings/org.eclipse.wst.jsdt.ui.superType.container
deleted: .settings/org.eclipse.wst.jsdt.ui.superType.name

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: .gitignore

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: .project
deleted: .settings/.jsdtscope
deleted: .settings/org.eclipse.wst.jsdt.ui.superType.container
deleted: .settings/org.eclipse.wst.jsdt.ui.superType.name

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: .gitignore

Untracked files:
(use "git add <file>..." to include in what will be committed)
.project
.settings/

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
weird you could try deleting and recreating the .gitignore file but I have no idea why it isn't ignoring these files
Danix
DanixOP2d ago
its ok no worries i will search upon it later but how to integrate the test branch with main
dan1st
dan1st2d ago
Do you want to completely overwrite the content of main with the content of test?
Danix
DanixOP2d ago
yeh
dan1st
dan1st2d ago
ok then first tery git add . and execute git status - it's safer/easier if you have a clean state
Danix
DanixOP2d ago
from the test branch ?
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: .gitignore

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: .gitignore

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
ok you can just reset the gitignore to the previous state using git checkout .gitignore and then check git status again
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git checkout .gitignore
Updated 0 paths from the index
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: .gitignore

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git checkout .gitignore
Updated 0 paths from the index
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: .gitignore

PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
oh, it needs to be git checkout HEAD .gitignore
Danix
DanixOP2d ago
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git checkout HEAD .gitignore
Updated 1 path from 53665c3
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

nothing to commit, working tree clean
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git checkout HEAD .gitignore
Updated 1 path from 53665c3
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp> git status
On branch test
Your branch is up to date with 'origin/test'.

nothing to commit, working tree clean
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
dan1st
dan1st2d ago
ok then you can do the following
# WARNING: THESE COMMANDS CAN BE DANGEROUS
git checkout main
git reset --hard test
git push --force-with-lease origin main
# WARNING: THESE COMMANDS CAN BE DANGEROUS
git checkout main
git reset --hard test
git push --force-with-lease origin main
The first command checks out main After that, the second command sets the current branch (main) to the test branch (i.e. it completely overwrites the current branch with the content of test). Then, the third command completely overwrites main on GitHub with your local main
Danix
DanixOP2d ago
ok done
dan1st
dan1st2d ago
looks good ig you can delete the test branch
Danix
DanixOP2d ago
hm but got confused a lot that why those errors and should i have to continue pushing code with main ?
dan1st
dan1st2d ago
which errors? pushing to main should be fine now
Danix
DanixOP2d ago
we are here with alot of errors !
dan1st
dan1st2d ago
Which errors?
Danix
DanixOP2d ago
git branch -d test

error: branch 'test' not found.
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
git branch -d test

error: branch 'test' not found.
PS C:\Users\jeena\OneDrive\Desktop\ScriptEnhancerApp>
whats the reason to make another branch and push our code in it
dan1st
dan1st2d ago
What is the output of git branch? the --force-with-lease` bypassed these by overwriting the branch on GitHub
Danix
DanixOP2d ago
ok not able to delete the test!
dan1st
dan1st2d ago
What's the output of git branch?
Danix
DanixOP2d ago
main
dan1st
dan1st2d ago
then it's already deleted locally but not on GitHub
dan1st
dan1st2d ago
GitHub
Branches · Deepak2250/scriptenhancerapp
Contribute to Deepak2250/scriptenhancerapp development by creating an account on GitHub.
Danix
DanixOP2d ago
ok
JavaBot
JavaBot2d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Danix
DanixOP2d ago
hey 0ne last question ! in future i have to commit the or add or push the code from the backend folder or otherr subfolder where the changes occured or from the parent app folder ?
dan1st
dan1st2d ago
in principle, both would work but the path can be different In general, I'd recommend using the parent folder in most cases
JavaBot
JavaBot2d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?