New Web Dev person and need help on GitHub - github

I am new to GitHub and having issues uploading a website.....
When I upload to GitHub, it separates folders (Here is the image of what I am seeing GitHub) and thus website doesn't display properly.
Here is the image of the file on my computer Here is what I am seeing on computer
I attached screenshots, any help would be great....
I am confused af at this point in time

Try To push changes correctly as it doesn't happen usually. Read this:
Open your Command prompt first then move to the particular which here contains your whole website.
Start with
git init (it will initialize your folder to be pushed up or pulled
to git Controls)
then git add . (To add All the files create your
.gitignore file carefully)
git commit -m "Whatever you want to write
us a note about the changes"
then git push -u origin main
Hope Your problem will be solved or maybe something you can only diagnose because you are there sitting and functioning
**Note If there is any folder containing called .git, delete that. Before proceeding the way I mentioned **

Related

What is the difference between uploading and cloning?

I am new to Github and I do not understand what is the difference between uploading directly a file from your computer by dragging it (Upload files option) and uploading through clone with SSH.
Is the first option just regular file uploader and the second an option that connects your repository with your local environment?
The reason for asking this is that I am trying to upload a .ipynb file but I do not want changes done in my local computer to affect the file I have uploaded. Is that possible?
Thank you in advance.
The drag 'n' drop option on the GitHub website it just a 'shortcut' for committing a newly added file in your (local) repository and then pushing it. After you released your left mouse button and the file is uploaded, the web interface even asks you to enter your commit message and the branch you want to push to.
Once you've uploaded the file via the website, the file on your computer has no relation to the file within GitHub, so changes are not reflected.
But even if you clone, local changes and even commits won't be reflected on GitHub, until you do git push.

How do I add a file in a subfolder to a new repository?

I have a repository for a website and it has two separate remotes. One is for the website files and one for datasets and R scripts to make some data in my blog posts reproducible and archived for the future.
My local file structure looks like this.
-Website
|
|--website-files/posts/blog-post1
|/blog-post2
|r_script.R
The folder Website has two remotes one - origin - for the website, and one - blog-post - for the dumping ground for my replication files.
So, because I have cleanly added a second remote, I tried to add the file r_script.R and push it to the remote blog-post.
git add website-files/posts/r_script.R
Then, though, when I check the status, git status shows the file name as untracked listed as
../../r_script.R
The precise question: How do I add a file in a subfolder to be tracked and then to push its own unique remote? Note, when I copy r_script.R to the folder Website, and run git add r_script.R it shows up as a staged file ready for committing.
But I would really rather keep it in the subfolder to keep it clean.
Maybe should I add the repo blog-post as a submodule to the subfolder website-files/posts/ or something like that?

GitHub Desktop doesnt pick and push the entire repository

I am using GitHub desktop application on my local machine and when I create and complete my repository(web directory)on my local machine, then I push it GitHub online through desktop application. But here is my problem:
Sometimes it doesn't pick and push all of the files/folders from my local repository, it only pick 3 files, while my repository has 5 folders and one inex.html file.
And sometimes it works perfectly fine. I never understand where is my problem. Any thoughts on this?
Do a git status before your push, as well as a git show HEAD to check the content of your last commit.
That way, you will see if there remain some files not added to the index or not committed.
And you will see if every files you wanted is in a commit.
If one file is consistently ignored, see if it is actually ignored by Git with:
git check-ignored -v -- a/file

New to git--just need to sync one file

I managed to finally get EGit in Eclipse to work (still don't know how) and I've committed/pushed my current project up to GitHub. So far, so good. Looking at it on GitHub's site, I see it wants me to make a README.md file to provide a nice description. Fine, I think, I'll just use the tool it's providing me with to get it started, then have it sync back down to my local computer where I can further modify it and keep it synced.
So I created a quick README.md file on GitHub's site. But now, when I perform a "Pull" action in Eclipse, I am told that there's nothing new to pull, or something like that. Why is it not getting the new file that was created on GitHub's site, and how can I get it so that I can make changes to it whenever I want?
If you have git installed you can use a terminal and type in the root of your repository:
git pull origin master
or you could try checking out only that file:
git checkout README.md

Cannot seem to push data to gitlab6 instance. New issues

I've created a new project, and I'm trying to add an entire directory to it. I've init'd git in the top directory, added the subdirectory, created a README with content, committed, done the 'git config' steps (user.name, user.email), added the remote. ~/.git/config is identical (save repo name) as that for another project.
When I do a 'git push -u origin master' the command line response tells me everything is up to date. When I go to look at the web instance, though, no files tab is visible.
In addition, I just created a new local repo, and did a git pull. The 2 directories were pulled over, but are empty.
I'm new (obviously) to managing a gitlab repo. I'd like to learn what I'm doing wrong, and how to accomplish what I need (a reliable repo for multiple projects). Right now, I'm fairly confused.