2

How to commit code into GitHub Server using eclipse ?

when I run this command

git push -u origin master

It shows the following error

error: The requested URL returned error: 403 while accessing https://github.com/something/something

Mel
  • 5,837
  • 10
  • 37
  • 42
Nitesh Singh Rajput
  • 607
  • 1
  • 7
  • 24

3 Answers3

5

I am not expert but i have done this once

think simple and straight way is

1.Download Git to your system

2.cd to your eclipse prject cd /workspace/sampleproject

3.Commands

git config --global user.name "Your Name Here"
git config --global user.email "your_email@youremail.com"
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/gitusername/reposname.git
git push -u origin master                   this line may throw an error but no problem

4.From eclipse ->Help->eclipse marketplace ->search for 'git' -> install 'Egit-git team provider'

5.Go to eclipse ->Windows ->Open perspective ->Git repository

6.From Git repository view on the left side on 'Add existing local repos' then browse to '/workspace/sampleproject'

7.Now Right click on this added Repository location and add comments press Commit.

8.Now Right click on this added Repository click Push

      By default Configured remote repository should be checked then press Next
      From Source Ref and Destination Ref  Select HEAD    //you may change if u want
      Select next give your github username and password then click on Finish.
TheUltimateGuide
  • 333
  • 3
  • 13
gYanI
  • 511
  • 5
  • 13
2

If you are using the https address, you need to pass your credential (Github login and password).
See "Syncing with github" for an example.

With Eclipse and Egit, you can set those credential when defining a remote address for your local repo.
See "Push upstream".

upstream credential

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Just Open the project perspective and click on Git, you will see the working copies of your project --> right-click on the project and choose the option commit. That's it

or

Right-click on your project and select team you can see various options related to git commands choose commit.

  • "commit" doesn't work at all. It looks like it's doing something, but nothing goes into the github repository. – pojo-guy Nov 07 '20 at 19:45