Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Says it commits, but in GitHub it doesn't show up

Tags:

git

github

I just installed rails on an Ubuntu machine. I set up git and made an ssh key to link to my account. I made a repository to commit to, and made a sample project to test with called first_app. When I make commits it says it was all committed, but I go to github and it isn't there. I want to put my project up there, but it doesn't have the connection for some reason. I've googled around and I'm not seeing anything so it must be some stupid thing I did. Is there a way I can check that everything is configured right?

Edit: Tried to set the remote address, but it was already right. It has the correct URL.

Edit2: Here is what came up in the terminal:

jonny@MM061-JD:~/first_app$ cat .git/config
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = [email protected]:JonnyDoeInWisco/first_app.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
jonny@MM061-JD:~/first_app$ git remote -v
origin  [email protected]:JonnyDoeInWisco/first_app.git (fetch)
origin  [email protected]:JonnyDoeInWisco/first_app.git (push)
like image 980
JonnyDoeInWisco Avatar asked Aug 31 '15 16:08

JonnyDoeInWisco


People also ask

Why don't my commits show up in GitHub?

Your local Git commit email isn't connected to your account Commits must be made with an email address that is connected to your account on GitHub.com, or the GitHub-provided noreply email address provided to you in your email settings, in order to appear on your contributions graph.

How long does it take for a git commit to show?

You can view these contents directly using git ls-files --stage . The time needed to write each of these objects is generally quite small, so in most cases, git commit is nearly instantaneous.

Why my git commit is not working?

Your answer This occurs because you might have git directories in other folders as well.

Where can I see my commits in GitHub?

On GitHub, you can see the commit history of a repository by: Navigating directly to the commits page of a repository. Clicking on a file, then clicking History, to get to the commit history for a specific file.


1 Answers

You have to push your commits from your local repository to the remote repository:

$ git commit -m "your commit message"

$ git push origin <branch_name>

Substitute <branch_name> with the remote branch you are pushing to (i.e. master branch would be $ git push origin master).

Without pushing your commit, you should see a similar message when you run:

$ git status

Git will tell you that you have commits that you need to push to your remote.

On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

Verify your remote repositories

If you are seeing an up-to-date status with your remote, you should verify you're actually pushing to the location/repo that you think you are:

$ git remote -v
like image 103
Thomas Stringer Avatar answered Oct 30 '22 15:10

Thomas Stringer