Github and some help starting out (Linux)

  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Linux
AI Thread Summary
To successfully upload a new directory to a GitHub repository using the command line on Linux, it is essential to follow the correct sequence of Git commands. After creating a directory, use "git add ." to stage all new files, then check the status with "git status" to confirm they are staged. Committing changes with "git commit -m 'Your message'" prepares the files for upload. Finally, execute "git push" to upload the committed changes to the remote repository. It's important to note that Git does not track empty directories; to include a new directory, create an empty file like ".gitkeep" within it. Many developers now use IDEs for Git interactions, with tools like VS Code and GitTree providing integrated support for version control tasks.
member 428835
Hi PF!

I am trying to learn github on Linux. I made a repository online called Leetcode, and added a folder "python" there. I wanted to try adding the directory "cpp" to the repository via the command line, so I thought I did this via the add command. To check and see if it indeed uploaded, I executed git status, and sure enough the file "cpp" does not appear, which makes me think it has been successsfully added to the repo "Leetcode". However, when I check online I do not see the file "cpp". The attached image should help if I've been unclear.

What should I do to ensure these directories are appropriately uploaded? Thanks so much for your help!
Screenshot from 2022-11-15 22-23-34.png
 
Computer science news on Phys.org
I'm definitely no expert at Github but I do use it all the time. When I want to add code to a repository, I do the following steps:

git status - Check on the state of the existing code changes (not new)
git add . - Add any new files (note the period)
git status - This will now show the files that you've added also
git commit -m "My checkin comment goes here." - Everything is prepped at this point.
git push - This actually pushes your commit to the github repo.
 
First, we need better screenshots. If I zoom into that, everything is hazy. Preferably, one window in one screenshot. All of us don't have large monitors.

Assuming you have committed the cpp folder, have you pushed it to remote?
 
Wrichik Basu said:
Assuming you have committed the cpp folder, have you pushed it to remote?
There is no such thing as "committing a folder", git only works with files. If you don't have anything to put in the folder for the time being create an empty file called ".gitkeep" in the folder and add and commit that.

In 2022 99% of most developers' interactions with git are through an IDE integration. Download VS Code and its git extension (I also like GitTree since similar functionality was removed from GitHub).
 
I came across a video regarding the use of AI/ML to work through complex datasets to determine complicated protein structures. It is a promising and beneficial use of AI/ML. AlphaFold - The Most Useful Thing AI Has Ever Done https://www.ebi.ac.uk/training/online/courses/alphafold/an-introductory-guide-to-its-strengths-and-limitations/what-is-alphafold/ https://en.wikipedia.org/wiki/AlphaFold https://deepmind.google/about/ Edit/update: The AlphaFold article in Nature John Jumper...
Interesting article about an AI writing scandal at Sports Illustrated: https://www.cnn.com/2023/11/29/opinions/sports-illustrated-ai-controversy-leitch/index.html I hadn't heard about it in real-time, which is probably indicative about how far SI has fallen*. In short, the article discusses how SI was caught using AI and worse fake reporter photos/profiles to write game summaries. Game summaries are the short articles that summarize last night's Phillies game. They are so formulaic that...
I've had it with Open Office Writer. Lost too many documents to spontaneous exploding. Even reflex Ctrl-S'ing every few minutes is too risky. I somehow managed to Ctrl-X a large table just before it exploded and I lost the entire thing. I'll give up some of the more sophisticated features. I want to set fonts/styles, use bullets, make tables and colour rows. Suggestions? I guess Google docs is an option, isn't it?
Back
Top