简体   繁体   中英

How to upload my files in github repository with command?

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:

这是错误

Thanks.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM