With Git for local and remote two-way transmission GitHub (synchronous GitHub repository)

Foreword

GitHub as necessary programmer learning platform, although the speed is not fast in the country, but as long as the good use of this platform, I believe you can still learn a lot of things. In the summer time, I have to first connect to the remote GitHub, but after school, I do not know why they not work. The man behind tried it, mostly failed on landing, this authorization fails, ssh and other issues. Write this blog to record it. Also I want to be able to read you a little help. (For the time has been connected and configured with ssh key)

step

First thing in their computer terminal was installed Git, I was already here somehow, can be used normally, as shown, Git Gui is a visual interface, but personally think it is knocked up more and learn the command line strong point, here choose git bash here (file location you want to upload).

Re-board connector implemented GitHub

  • First git init (in the specified folder)
  • Then git add files (folder /) follows the git add 1 / I want to use file folder in the computer named 1
  • git commit -m "comment"
  • To submit information and to view some status information via git status
  • git pull --rebase origin master
  • git push -u origin master (this step is the last to be performed)

 -

Direct git pull time will complain, but when I ssh directly connected to the display

Online to find some information about the pull

git pull = git fetch + git merge FETCH_HEAD

git pull --rebase = git fetch + git rebase FETCH_HEAD 

Dealing with conflicts on the branch on git pull --rebase, it is used in merge code when its role is in a randomly created, to avoid direct contamination of the original partition

rebase not result in a new node, the two branches are fused into a linear commit.

 

 

 Finally landing GitHub found to have been successful. The local file has been successfully synchronized to the on GitHub.

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/yhycoder/p/11832517.html