简体   繁体   中英

how do i get files to the github server?

This question involves github. It might need to be migrated to another site.

How do I get files to the github server?

I've setup my user.name, user.email, and github.token on the client side

also, I've also translated my SSH key to the server side at github.com.

I verified SSH by using

ssh -T git@github.com

SSH is working

According to the directions, you simply stage your files, commit them, and push them.

When working in the Bash Shell I use

git push origin master

However this gives me the error...

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

I'm basically following the directions from here

http://help.github.com/

Setting up Git, and Creating a Git Repo.

Create a repository on Github. Follow the instructions from there.

you already have something committed there that's ahead of what you have.

git fetch

then

git log --all --graph # or gitk --all

to see what those changes are.

If you want to ignore them and blast the history (not recommended if you are working with others on there) force the push:

git push -f

or, rebase or merge your changes on top of whatever is on the server:

git merge origin/master # assumes you are on the master branch

or

git rebase origin/master

Now you should be able to push:

git push origin master # can be just git push if you are tracking

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