Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9080205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:01:28+00:00 2026-06-16T20:01:28+00:00

I have a Java project in my workspace, which I am trying to push

  • 0

I have a Java project in my workspace, which I am trying to push to GitHub.

I am a first-time Git user and didn’t create a GitHub account yet.

These are the steps I followed.

  1. Initially from the source code folder, I did:

    git --bare init

  2. Again I ran the git init command:

    git init

  3. Created a remote repository:

    git remote add origin ssh://ravi.kiran.com/home/sai/workspace/Sai

  4. Then, I place my local files under version control.

    git add .

  5. git commit -a -m 'initialize repo'

  6. Then I set my global configurations:

    git config --global user.email "ravitest@gmail.com"
    git config --global user.name "ravikirantest"

  7. Result of git config -l:

    sai@ravikiran:~/workspace/Sai/src$ git config -l
    
    user.email=ravitest@gmail.com
    user.name=ravikirantest
    
    core.repositoryformatversion=0
    core.filemode=true
    core.bare=false
    core.logallrefupdates=true
    
    remote.origin.url=ssh://ravi.kiran.com
    remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
    

Please tell me how can I view my repository in GitHub!

After this, I even created a GitHub account with the above specified
email and username, but I am not able to view my files on github.com.

Updated Part

sai@ravikiran:~/workspace/Sai/src$ git push origin master

Username for 'https://github.com': ravikirantest

Password for 'https://ravikirantest@github.com': 

To https://github.com/ravikirantest/Chandrayan.git

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to 'https://github.com/ravikirantest/Chandrayan.git'

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')

hint: before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

sai@ravikiran:~/workspace/Sai/src$ 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:01:29+00:00Added an answer on June 16, 2026 at 8:01 pm

    Once you have created your account on GitHub, you will be able to create a new repository from the GitHub web interface.

    Once you have created this repository, you will see (detailed in GitHub on your repository page) the URI for it. You can then set this as a remote from your local machine and then push to it.

    The procedure on your local machine would be as follows:

    git init
    git add . 
    git commit -m "initial commit"
    git remote add origin https://github.com/[your account]/[your repository]
    git push origin master 
    

    I think perhaps part of your confusion is not recognizing the difference between Git as a version control system and GitHub which is a service for hosting projects. Git will work completely independently of GitHub. Or you can use GitHub to host your core repository as described above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a directory structure D:\workspace 2\project\lib where I have all the files AgentMain.java(which
I have a Java project that I'm trying to implement with a model-view-controller design.
I have a java project in which I have Referenced Libraries. In the Referenced
I have a large project in my workspace. Each time I save a jsp
I have three projects in my workspace : prjData, a simple project (no java
I have both a Java and a PyDev project in one workspace. When I
I have an Android Maven project, which uses pure Java libs, I've struggled with
I am using Eclipse+Java and trying to create files under my current project. I
I have a workspace with a bunch of java projects. If I go to
I have a java project that uses JPA 2/Hibernate 3.5.6 for data access and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.