Git command to commit a local replaced project to remote master
I am a total newbie on github. Now I am facing a problem which is:
I uploaded my new project to github,with a same repo name as the project folder.
Then I messed up the codes on local,want to recover the version I uploaded to github. Without knowing how to do so with github desktop client or git command, I deleted the folder from my local(laptop), then download the github copy and place it in the same directory.
Now I have some update in my codes and I want to upload my newest version to github, commit to master branch, but I cant find the way to do so with desktop client or command. I tried to directly upload the whole folder to github website but cannot because the folder have exceed upload limit of website upload: more than 100 files inside.I also tried git command like:
git push fypsubmission master fatal: 'fypsubmission' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Please let me know what should I do, thanks
See also questions close to this topic
gitlab transportexception error while committing from branch in eclipse
I am using eclipse and gitlab server for code structuring, and we have local LAN gitlab server where we can handle branch and every gitlab process.
I get an error while pulling to the gitlab local LAN server. My exception is a transportexception [org.eclipse.git.api.errors.transportexception] and while searching for the bug on the server side, I can find some error like main branch where we will merge all kind of code. And that main branch has been file or files may be corrupted.
Is their any possible way to solve this problem?
How to clone using git and chain git config user.name
I want to do command chaining with git. I want exactly to clone a repo then set the configurations for that working copy changing user.name, user.email.
I tried this:
git clone https://repoUrl.git && git config user.name "Khaled" && git config user.email "email@example.com"
But I got this error:
error: could not lock config file .git/config: No such file or directory
issues with docker container . unable to execute anything
I am cloning a repo to docker container. As i wanted to delete the older version, i simply run this command
rm -rf * /serving. This deleted my whole git inside the container. Now I am unable to find git inside it.
It says No such file or directory exists. But i typed
type gitthis gives me,
How do i solve this?? I am using dockertoolbox for Windows 7
I am unable to do anything inside the container line
docker run, i guess there is some problem with the container
I cannot upload any file from GitBash after uploading then deleting a big file in GitHub
Accidentally uploaded a big file to GitHub, then deleted it in local repository. After this action, everytime I want to upload file, it tells me there is a big file. However, when I try to find it on my repository, GitHub cannot find it. Now I cannot upload any file from GitBash. Is the big file hide somewhere I didn't notice? Thank you!
How to update pywin32 automatically?
As I understand, one cannot use pip to install/upgrade
pip install -U pypiwin32is a workaround.
pywin32is now hosted on GitHub. I know very little of
gitbut know that it works with binary files. Is there a way to programmatically upgrade the
pywin32binary? That is, say
pywin32v221 is installed with Python v.3.6 (64bit), the program should check against the latest (v223) on GitHub and download the
pywin32-223.win-amd64-py3.6.exeand install it. So far, I can only think of a web-scraping-like script that compares the installed version with the latest version on the web and act accordingly. I wonder whether there's a simple solution.
How to resolve merge pull request conflict for .DS_Store the easiest way?
I'm fairly new to Git and Github and also gotten very confused at Git's vast array of command line. Today I push my commit like usual and create a pull request. But when my coworker tries to merge, it shows:
This branch has conflicts that must be resolved
Use command line to resolve conflicts before continuing.
I would like to resolve this using steps as simple as possible. I used subversion SVN in the past, and it has a very easy solution: "use 'theirs' version" or "use 'mine' version". I would like to be able to right click somewhere, and choose "use 'theirs' version" on this
.DS_Storefile, and don't care with whatever its contents is. All I want is for the conflict to go away. I don't know where I can find that feature in Github. I've tried to browse Git command lines for this, but I don't know exactly which one to use. The problem is, this is pull request merge conflict, which 'happened' at the server. My commit that has the .DS_Store is the 2nd last commit. The last commit on my branch is a "rebase" from the master branch. So if I want to revert to my commit, I will have to revert the rebase commit as well, and I don't know what's the side effect of it (won't I be able to do a "rebase" again because I have already do a "rebase"? I don't know). I can't solve this at my or my coworker's computer because I can't pull the conflict from the master branch from the server to my local computer. How should I fix this? Thanks.
Working with Github
Can anyone help me?
I recently started using github to store my projects. I'm a little confused on how it all works. I'm using visual studios 2017 for my projects and I'm uploading them from there to Github.
I'm working on a particular project and need all the files under one repository but VS keeps creating multiple Repositories.
Can someone help me/teach me how to combine repositories, or tell me how to upload complete folders to my repositories? The reason I say complete is because when I try to upload folders directly, GitHub takes out all the contents in the folder.
Unable to execute Git Push Atom Git-Plus
While trying to execute Git Push facing the following error in Atom Git-Plus
fatal : HttpRequestException encountered. An error occurred while sending the request.
bash: /dev/tty: No such device or address
error: failed to execute prompt script(exit code 1)
fatal: could not read username for https://github.com': No error
Cloning repository from git-lfs
I'm storing 300MB .blend file on git-lfs, rest of the repository I store normally. Yesterday I got info my limit on git-lfs has ended. I've had already commited filed but not synced, because of this error. So I've just copied this files which I modified yesterday on my desktop. The easiest way which I earlier discovered it was just to delete repository from computer, than clone It again to remove this last bugged unsyncable commit. But the main problem is today, when I try to clone this files I get error. (It breaks when It starts cloning this 300MB file). Earlier it's been cloning correctly with no problem from this file from lfs. So my question is:
If I pay for new 50gb limit, will it work?Or maybe problem is in another thing. I just want to be sure that I have to pay because It would be my first github billing and I dont want to waste my money. By the way, sorry for my english.
How to include git submodules and their physical files in parent repository?
The story starts from a git repository. Let's call it pet-shop. The pet-shop has 2 folders containing different projects.
--pet-shop <== this is a repository --web <== subfolder angular project --rest-api <== subfolder python project
Due to within the same git repository, there is an issue that when developers commit changes to either pet-shop/web or pet-shop/rest-api the history logged to pet-shop. This makes no sense. Like as someone working within web, he/she doesn't need to know what's happend in rest-api.
Therefore, I was trying to split them out. I noticed git submodule feature. After spending an hour on googling. It now ends up 3 git-repositories.
--pet-shop <==== this is a git repository --web @9se5082 <==== refer to git repo pet-shop-web --rest-api @defs02d <==== refer to git repo pet-shop-rest-api --pet-shop-web <==== this is a new git repository --pet-shop-rest-api <==== this is another new git repository
This meets the initial requirement now. I could commit changes separately.
Logically they are connected; Physically they are stored respectively.
My question now is, the way of doing this consumes 3 git repositories, could it be done by 1 repository?
How to see count of outgoing and incoming commits in git cli
While working with eclipse and git, I was able to see the counts of incoming and outgoing commits in the project explorer. I am trying to see the same thing from git CLI but do not find any command for this over the internet and git documentation.
So can someone please help to get the answer how the git plugin in eclipse is doing this or there is any command which I may have missed.
$ git commit --amend not altering/saving commit message
$ git add .some changes I made to one of my repositories followed by
$ git commit -m'INcorrect commit message'.
I decided to change the incorrect commit message to 'Correct commit message' using:
$ git commit --amend
The instructions I followed to do this can be found here: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages
I use Atom, so Atom opens with 'INcorrect commit message' displayed, which I change to 'Correct commit message' and save my changes.
After I saved the altered commit message, I did a
$ git log -1expecting to see 'Correct commit message'; however, I still see 'INcorrect commit message.'
What exactly am I doing wrong?
Just prior to this, I changed my git editor from Sublime to Atom following these instructions: How do I make Git use the editor of my choice for commits?
I basically used:
$ git config --global core.editor "atom"
$ export GIT_EDITOR=atom
I realize now that I didn't have to do both, but I also realize this probably didn't hurt either.