This is a record of the use of git, but the usual problems encountered in the work of the solution, will not involve some of Git's basic concepts and instructions. human nature is so cool thin, as long as the better to change, will be willing to.
Some git use one, after the code cloud set up a good warehouse, want to put the local already written code to push up.
First GIT init our project:
[Email protected] mingw64/g/java/go/program/2017-05-18/learnpython1$ git initinitialized empty git repository in G:/java/go/ program/2017-05-18/learnpython1/.git/
To add a project to a local warehouse:
[Email protected] mingw64/g/java/go/program/-LearnPython1 (Master) $ git Add.
Submit code to the local repository:
[Email protected] mingw64/g/java/go/program/ .- to- -/LearnPython1 (Master) $ git commit-M'Commit Python code'[Master (Root-commit)4408093] Commit python code theFiles changed,5905Insertions (+) Create mode100644. idea/misc.xml Create mode100644. idea/modules.xml Create mode100644. idea/workspace.xml Create mode100644LEARNPYTHON1.IML Create mode100644datagram/connmysql.py Create mode100644datagram/funutils.py Create mode100644datagram/huhx.py Create mode100644file/bookdata.csv Create mode100644file/huhx.png Create mode100644file/huhx1.txt Create mode100644file/huhx2.txt Create mode100644file/log.txt Create mode100644file/log1.txt Create mode100644file/seach_button.png ...
Connect to the branch of the server:
[Email protected] mingw64/g/java/go/program/-LearnPython1 (master) $ git remote add origin HTTPS://gitee.com/huhx/pythonlearn.git
Push code to Remote repository:
[Email protected] mingw64/g/java/go/program/ .- to- -/LearnPython1 (Master) $ git push-F Origin mastercounting objects:137, done. Delta CompressionusingUp to4threads.compressing objects: -% ( the/ the), done. Writing objects: -% (137/137),127.37KiB |1.46mib/s, done. Total137(Delta1), reused0(Delta0) to https://Gitee.com/huhx/pythonlearn.git+ 45c1fff ...4408093Master-, Master (forced update)
Note that the above push is required with the-f parameter, if not added. There will be the following error message
[Email protected] mingw64/g/java/go/program/ .- to- -/LearnPython1 (Master) $ Git push origin Masterto https://Gitee.com/huhx/pythonlearn.git! [Rejected] master,Master (Fetch first) error:failed to push some refs to'Https://gitee.com/huhx/pythonLearn.git'Hint:updates were rejected because the remote contains work DoHint:not has locally. this isusually caused by another repository pushinghint:to the sameref. Want to first integrate the remote changeshint: (e.g.,'git pull ...') before pushing Again.hint:See the'Note about Fast-forwards' inch 'git push--help' forDetails.
Second, establish some basic operations of the Branch, update or submit the code
The whole of a process can be as follows:
To create a development branch:
git checkout huhx-Dev added to git management:
git Add. Submit to Huhx-dev local repository:
' Code ' Switch to the master branch:
git checkout master updates the code from the Remote repository:
Git pull merge huhx-dev branch:
git merge huhx-Dev submitted to the local Mater repository:
' Master Commit ' submit the local master code to the remote:
Git push Origin Master
For branch creation, view can refer to blog: http://blog.csdn.net/arkblue/article/details/9568249.
Friendship Link
Java Foundation----Use of >git (i)