0

I have created a repository named amarjobs.

There is no file now.
I want to upload my working file in this repository.
I have done some step:

 git init
 git remote add origin url
 git pull 
 git push origin master

But its throws an error.I am beginner with git.
I have searched but i do not get satisfied answer for my problem.
Could anyone solve my problem?

Error:

This is the error

Thanks.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
Chonchol Mahmud
  • 2,717
  • 7
  • 39
  • 72
  • You may have a look at the github guide if you haven't already: https://help.github.com/categories/managing-remotes/ – Warrior Apr 17 '16 at 10:07

1 Answers1

1

You cant push since there are changes in the remote branch which you do not have.
You can simply execute git pull before the push and it will fix this issue.


Follow those steps and you will be able to push your code to github:

# Create a git repository in the folder
git init

# add the remote url
git remote add origin git@github.com:chonchol/amajobs.git

# add your code to the repository
git add .

# commit your code
git commit -m "Message..."

# now once you have your code committed updated your branch with the remote code
git pull 

# now once you have the commit message of the merge - commit and push
git push origin master
CodeWizard
  • 128,036
  • 21
  • 144
  • 167