Github pages missing submodule? - github

I followed the exact instructions (more than once) to make a github pages site, and I got an e-mail with this error
The page build failed with the following error:
The submodule `msgBored` was not properly initialized with a `.gitmodules` file.
The page it linked me to told me absolutely nothing about how to fix this, I am very new to Github, this is my first time attempting it. Thanks!

This is mentioned in "Page build failed: Missing submodule".
You can see if the submodule initializes with:
cd /path/to/main/repo
git submodule init
git submodule update
But if you don't have any .gitmodules, then it actually is a nested git repo, and you would need to remove that entry before (if you really need it), add it as a proper submodule
cd /path/to/main/repo
git rm mysubmodule # no trailing slash
git submodule add -- /url/to/submodule/remote/repo

Related

Why is it appearing like I have pushed my code to github but I got to my profile and the code is not there?

What am I doing wrong?
Why will my code not show on github even though it appears to have pushed saying clean tree.
What am I supposed to be entering when it asks for git credentials osxkeychain?
Hello I have been watching video after video and reading the documentation on github and how to use it but nothing seems to be working. I have created a repo in my account and done the following:
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/stephBrandon/PythonNumberGuessingGame.git
git push -u origin main
it responded by saying initialized empty git repo in my folder which is true when hitting ls -a there is a .git file and there is a readme now as well
But when checking on my github none of the code it there and in the terminal it seems to be trying to access my old git hub account instead of my new one and I have no idea what to do now.
remote: Permission to stephBrandon/PythonNumberGuessingGame.git denied to stephanieBrandon.
fatal: unable to access 'https://github.com/stephBrandon/PythonNumberGuessingGame.git/': The requested URL returned error: 403```
I had issues with the keycode and went into my key chain to see if I could change it there or if I was entering the wrong password but the one I had I deleted and it wont allow me to add another like some other videos I have watched.
Please help. I just want to know how to start using GitHub as I am in year 2 of my program and want to have a visible portfolio of my work without the frustrations of not figuring out how to use GitHub and it always seeming to take longer to upload to GitHub then the projects themselves sometimes.
If I am missing something in my explanation above here is a copy of the terminal
```(base) stephaniebrandon#Stephanies-MacBook-Pro-2 Lab4Random % git commit -m "First commit for Python Guessing Game"
[main e955053] First commit for Python Guessing Game
1 file changed, 44 insertions(+)
create mode 100644 lab4.py
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 Lab4Random % git remote add origin https://github.com/stephBrandon/PythonNumberGuessingGame.git
error: remote origin already exists.
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 Lab4Random % git remote add origin https://github.com/stephBrandon/PythonNumberGuessingGame.git
git branch -M main
git push -u origin main
error: remote origin already exists.
remote: Permission to stephBrandon/PythonNumberGuessingGame.git denied to stephanieBrandon.
fatal: unable to access 'https://github.com/stephBrandon/PythonNumberGuessingGame.git/': The requested URL returned error: 403
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 Lab4Random % ls -a
. .. .git README.md lab4.py```
Additionally, when I try to do
```git push -u origin main```
it doesn't do anything but enter a loop that I have to control c to get out of.
If you are okay with using SSH instead of HTML, this should be the easiest way. This is assuming you have not local .git folder (you can delete it if you don't have git history you'd like to save).
Part 1: Set up SSH with GitHub
First, open your terminal and run this command:
ssh-keygen -b 4096 -t rsa
When it asks you for a file name and save location, just hit ENTER to use defaults. Unless you feel it is necessary you can skip the password requirement the same way.
This will create a new (hidden!) folder named .ssh and two files in it: id_rsa and id_rsa.pub. id_rsa.pub is your public key. This is how you will authenticate with GitHub. Never share your private key (the other file).
Now, go to GitHub and sign in normally. Then, go to your profile settings (pictured below).
Then to this setting...
And hit this green button:
Give it any title you'd like, such as the name of your computer, and paste in the contents of your id_rsa.pub file into the box and hit "Add SSH key". You should be able to open either of the two rsa_id files with any text program.
Part 2: Setting up a Repo
In my experience, the easiest way to get Git configured correctly is to do this method rather than setting the upstream yourself.
First, make a new repository on GitHub. It doesn't matter if it's private or public, but add at least one file (such as a readme or .gitignore) to generate the first commit.
Now, you should be directed to your new repo. If you get a weird screen telling you to run some commands you likely didn't add any files when setting up the repo.
Assuming that you see the page, however, click the "code" button on the top right and select SSH. Copy it to the clipboard. (pictured below)
Part 3: Setting up your local repo
Open your terminal of choice and run
git clone git#github.com:[your details here].git
It should clone the repo and set the upstream for you. If you get an error here you likely have issues with your SSH settings.
Once you have the repo cloned, drag in any project you'd like and treat it like normal!
git status
git add *
git commit -m "Your message"
git push
Hope that works for you! Let me know if you have any problems.

Unable to add git subtree

I am trying to establish a git subtree in my project and for some reason I keep getting a message saying You must provide the --prefix option. I am making a Flutter project and the project repo (as well as sub repo) are both on gitlab.
Below is the command that I am running in the console while in my root project directory.
git subtree add —-prefix=subtrees/mysubtree https://git.company.com/subdirectory/subtree_repo.git master — squash
I have experimented a little with the command. For instance I tried —-prefix subtrees/mysubtree (sans =), as well as git config alias.sba 'subtree add --prefix subtrees/mysubtree / https://git.company.com/subdirectory/subtree_repo.git master —-squash'.
The last command doesn't throw any errors and it actually triggers pub get but no files change and no directories are added (at least not to the root which is where I am running the command).
I am not really sure what I am doing wrong and the messages (when there are messages) aren't very informative. I have checked my syntax and referenced it with Gitlab as well as with this post.

GitHub repository folder icon is black and not click-able

I am new to GitHub and finding it incredibly hard to learn. I am following the instructions here to create new repositories from an existing directory containing the project and typing git init ... etc.
However I created a repository in the wrong place and then deleted it by going into Settings at github.com. Then, when I tried to re-push the files the way I wanted it, one of the subfolders is now black (the one I had just deleted the repository for) and now not clickable - i.e. does not appear to be there. See statistics_project1 in screenshot below.
It's very hard to troubleshoot a problem like this. There is no error message or explanatory text when you hover over the black sub-folder.
This post seems similar but I don't know. The solution looks complicated.
Cannot remove submodule from Git repo
Could someone please tell me what a black 'unclickable' folder means in a github repository?
Cannot remove submodule from Git repo [duplicate] had give the answers and steps to do if you have git installed.
"Via the page Git Submodule Tutorial:
To remove a submodule you need to:
Delete the relevant section from the .gitmodules file.
Stage the .gitmodules changes git add .gitmodules
Delete the relevant section from .git/config.
Run git rm --cached path_to_submodule (no trailing slash).
Run rm -rf .git/modules/path_to_submodule
Commit git commit -m "Removed submodule "
Delete the now untracked submodule files :rm -rf path_to_submodule"
copy from remove a submodule
In fact the solution was a lot simpler. The 'blackened' folder is in fact the old repo that was not properly removed locally. As recommended by the author of the minimal tutorial I mentioned above, I simply removed the .git subdirectory which contains all git info and then re-pushed the repository to github.com and now everything is back to normal.

Git add not working

I tried to use git add eu and now I'm getting the following error:
fatal: pathspec 'eu' did not match any files
How would I upload my existing Maven project to Github? I've tried many things but couldn't manage to upload it so far.
Try to include the correct path of your file like this : git add pathToYourFile.extension. If you would like to add all files so use
git add .
Try using the command git add . to stage your whole project.
To add your entire project, do what the other commenters have suggested.
git add .
git commit -m "Your message."
To add the project to Github, you first need to create a repository in Github, and then add that newly created repo's URL as a remote on your computer. Then push it up. They give instructions after you create your repository.
Note that you'll need to manually push up changes in the future with git push, unless you have a post commit hook or something set up to automate it.

Getting an API set up from GitHub

I've set up my github account and I'm ready to go. I'm trying to follow these instructions, for setting up an API wrapper for an iPhone project using Soundcloud, but I'm a bit lost:
1. Go to your project directory.
2. Add the Cocoa API Wrapper as a Git Subproject
git submodule add git://github.com/soundcloud/cocoa-api-wrapper.git SoundCloudAPI
3. Update the Subprojects (the API Wrapper includes the NXOAuth2Framework as a subproject)
git submodule update --init --recursive
My questions are: Where do I go in my project directory? The same level as the XCode project file? Also, the command in #2 doesn't really work for me. I get the error:
fatal: Not a git repository (or any of the parent directories): .git
Am I missing something?
These instructions assume that you're using git for your project. And according to the error message, you don't. So, probably, you want at least to git init your project, but probably you will want more.
As for where to go in your project — where you want the SoundCloudAPI to reside. Which will be created in the current directory.