美文网首页
Git-GitLab Note:

Git-GitLab Note:

作者: JoeJiang | 来源:发表于2018-11-13 17:47 被阅读5次

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.

相关文章

网友评论

      本文标题:Git-GitLab Note:

      本文链接:https://www.haomeiwen.com/subject/jkulrftx.html