Problem: files from .gitignore are pushed to github
Steps:
created new repo on github from my repl
created .gitignore via shell in repl
added code_to_ignore.py
into .gitignore
executed in shell from root
git add .
git comit -m 'some commit'
git push
Expected result: no file code_to_ignore.py
Got result: all the files are on github
appreciate any help
Hey, @amikhailovskaia welcome to the forums!
Can you please provide a link to the repl? This way it is easier for staff and members of the community to help you!
Also see this guide on how to share your code:
To share your code with others, you can simply link to your repl or paste and format the code into your post!
Linking to a repl
The easiest way to share your code is by linking to your repl. You can find the link by clicking on your repl title, clicking the three dots, selecting “Cover page,” and copying the cover page URL.
NOTE: only share repl join links or use the invite button with people you trust!
[Kapture 2022-06-23 at 16.51.07]
Sharing short code samples
Share a snippet of your cod…
Git will still track and include them in the repository. The .gitignore
file only affects files that are untracked at the time the file is added to the ignore list
try these commands
git rm --cached code_to_ignore.py
git commit -m "Remove files from Git tracking"
git push
replace “Remove files from Git tracking” with the actual files, well its a commit message so adjust it as you deem helpful
1 Like
It was really helpful,
thank you!
system
Closed
May 29, 2023, 2:34pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.