Solve the question :
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.
1.use enforce way "push"
$ git push -u origin master -f
! but it is will amend the file or lose the file, especially in the development of co-operation.
2.pull the repository before you push the file:
$ git pull origin master
$ git push -u origin master
3.build a new branch then mergy
$ git branch [name]
then ** "push" **
$ git push -u origin [name]
! after git 2.9.2 nedd add "--allow-unrelated-histories" after it
Git command
git init // put the catalog change to a repository of git
git add README.md // add some file
git add . //add all files
git commit -m "first commit" //commit files to repository
git remote add origin git@github.com:wangjiax9/practice.git //relate the repository with local's
git push -u origin master // push to repository finally
Joe.
网友评论