Push modified file back to git without fetching - github

I create a git, pushed a file to it, TempMonitorGPRS.ino from my mac.
I tested the code, got some logs that I wanted to save. So I copied the log results and created a file, manually, in my repo. I made some changes to the .ino file which I want to push back to the repo from my mac. But when I try to git push -u origin master, I get a warning that I need to git pull first to get those files that I created manually, into my local mac. I dont want to get those files. Is there any way for me to continue pushing changes to my .ino file without ever getting those files onto my local computer?

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.

New Web Dev person and need help on 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 **

Accidently deleted every file in Vs Code while trying to push to git, any way to recover them?

I am a complete noob so while trying to deploy one of my programs to heroku, I needed to push it to github, in Vscode while trying to do that, I got a whole bunch of files that I didn't want to upload on github, so I hit remove all from this screen
I now realize that I deleted everything and I don't know what I can do, I tried going into my drive and hitting properties to try and restore but looks like I hadn't turned that feature on. Is there anyway I can recover my files? I am on windows
Simply go to your terminal and navigate to the folder you are pushing to git. You can run these commands:
git log --pretty=oneline (Shows all previous commits)
git checkout . (This resets everything to the previous commit)
Once you have reset your project to the previous commit, try again and delete the files you wanted to remove. Then perform the git commit -am "text here" and git push heroku master commands.
EDIT: This only works if you have already made git commits. If you have deleted everything and git log --pretty=oneline does not show any commits, then there is no way to recover the deleted files.
You can also check the recycle bin of your computer to see if the deleted files are there.

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

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.