Dev for next development
Common commands:
Git config--global user.name git config--global color.status auto git config--global color.diff auto git remote-v/ / View the git path of a remote branch
version control system.Git is free software.
Must be put inlearngitDirectory (sub-directories are also fine), because this is a git repository and it cannot be found in other places.
It takes only two steps to put a file in the GIT repository than to put the elephant in the refrigerator.
Step 1: use commandsgit addTell git to add the file to the repository:
$
warehouse with a versioned projectScp-r my_project.git [email protected] git.csdn.net:~ # Upload the repository to the servermkdir robbin_site.git cd robbin_site.git git--bare init # Create a pure warehouse on the servergit remote add origin [email protected] Github.com:robbin/robbin_site.git # Set up the repository addressGit push-u Origin Master # client First CommitGit push-u origin Develop # First submits the local develop branch to the remote
warehouse with a versioned projectScp-r my_project.git [email protected] git.csdn.net:~ # Upload the repository to the servermkdir robbin_site.git cd robbin_site.git git--bare init # Create a pure warehouse on the servergit remote add origin [email protected] Github.com:robbin/robbin_site.git # Set up the repository addressGit push-u Origin Master # client First CommitGit push-u origin Develop # First submits the local develop branch to the remote
my_project.git [email protected] git.csdn.net:~ # Upload the repository to the servermkdir robbin_site.git cd robbin_site.git git--bare init # Create a pure warehouse on the servergit remote add origin [email protected] Github.com:robbin/robbin_site.git # Set up the repository addressGit push-u Origin Master # client First CommitGit push-u origin Develop # First submits the local develop branch to the remote develop branch, and the trackgit remote
a versioned projectScp-r my_project.git [email protected] git.csdn.net:~ # Upload the repository to the servermkdir robbin_site.git cd robbin_site.git git--bare init # Create a pure warehouse on the servergit remote add origin [email protected] Github.com:robbin/robbin_site.git # Set up the repository addressGit push-u Origin Master # client First CommitGit push-u origin Develop # First submits the local develop branch to the remote develop branch,
a versioned projectScp-r my_project.git [email protected] git.csdn.net:~ # Upload the repository to the servermkdir robbin_site.git cd robbin_site.git git--bare init # Create a pure warehouse on the servergit remote add origin [email protected] Github.com:robbin/robbin_site.git # Set up the repository addressGit push-u Origin Master # client First CommitGit push-u origin Develop # First submits the local develop branch to the remote develop branch,
Git distributed version control system, very abuse of a version of the management system, this post describes the common GIT commands, for not GIT version control of the rookie, for the maintenance of the GIT server Daniel, kneeling for advice, in fact, I am also a rookie.Gi
1. Git document https://github.com/progit/progit/blob/master/zh/02-git-basics/01-chapter2.markdownhttps://github.com/progit/progit/tree/master/zhhttp://www.uml.org.cn/pzgl/201204285.asp if it is a Windows operating system, you can install a visual version controller: Turtle. In this way, you do not need to run the GIT command. Small turtle installation configurat
following example uses token instead of pass (because 2FA is used):Https://linus:[email protected]Merge 1. Historical merging of the current branchGit merge topicBecause Git is a distributed system, the history on the local and server may be inconsistent, so you need to merge the server and the local.Topic refers to a named commit on the local branch.2. Abandonment of the mergergit merge--abortUsage Prerequisites : Before using
Git common commands initialize the repository
Create a new warehouse to manage existing projects, enter the project directory and entergit init
PS: The command will create a. git directory, but will not proactively incorporate the files in the existing project (you need to add them yourself);
Clone Warehouse
Four status of files
you push the project OK.[email protected]:d Efnngj/hibernate-demo.git is the address of your common new warehouse. git switches to the new project, before push, with this sentence, the new warehouse we created is connected to the new project.Attention:1. The process of generating SSH keys can be consulted in the official documentation Https://help.github.com/articles/generating-ssh-keys2. Use git bash to e
a long string, it is cumbersome to remember.Tag management is a big part of the time.(1) Label the current branchGit branch #查看当前所在的分支git tag tagname #给当前分支贴个标签git tag #查看当前的标签[[email protected] gitstudy]# git tag v1. 0 [[email protected] gitstudy]# git tagv1. 0Label a branch of history that forgot to labelUse the com
git branch New Branch
git checkout Switch to Branch
git checkout -b -bnew local branch and switch to branch, -t bound distal branch
Collaborative processes
First fork The remote project
Putting the fork past the project is your project clone to your local
Run to git remote add add s
As a result of a Web project to go to the turntable network (http://www.quzhuanpan.com), and a few friends to do, considering the code hosting, teamwork, so in-depth study of git, the following are some common git commands, share to everyone, I hope you like.1. Create an empty repository (admin, normal user ignored)Git
1. What is git?
Official definition: git is a version control tool.The version here is actually the Code released every time. Git saves the Code submitted every time and gives it a number called "version number. This is similar to the process of publishing a journal. Each publication has its issue number.2. Why use git
Common commands of svn and git are commonly used: 1. gitpull // indicates updating the latest code on the server to the local device. 2.1, gitadd file path strength and file name 2.2, gitcommit-m quot; comment quot; 2.3, gitpush // The above three instructions complete code submission to the server. 3,... svn and git common
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.