gitHub commonly used commands and tricks

http replace ssh

git remote -v
git remote remove origin
git remote add origin [email protected]:amycing/ying-sql.git
git branch --set-upstream-to=origin/master master
git pull

Replace the connection before disconnecting the remote connection

git remote remove origin
git remote add origin [email protected]:amycing/ying-sql.git
git push -u origin master

git uncommitted, updates are covered:

  1. backup file
  2. If you modify a file after the update is not required, then
    git the Add.
    Git the RESET --hard
    withdraw to the last commit state
  3. VCS - UnStash Changes- choose one, click on the right side of view, is not a look you do not commit today lost something
    idea to pull the code, will first have add something but did not commit temporary storage Stash up, in this staging area, if you pull the code problems, there is no automatic recovery of staging something, you can restore it manually
    should be above two -month date ** point to see is which, then selected, click Apply to be on the line
    after Apply, automatically put back into the project, the state becomes not commit the
    time if taken out of Stash conflict there, the next step will let you resolve the conflict, then figure on the line, so you scratch content will not be lost
    (first commit, then pull, to be covered is someone else's responsibility, generally will not cover, if two people have modified a file, it will generate a conflict, then the idea will let you manually merge )

Guess you like

Origin www.cnblogs.com/xiaoyinger/p/12065855.html