Create a git project warehouse $git Init configures the personal registration information so that when team collaboration, you can see which user modified which Files $git config--global user.name ' cfanbo ' $git config--global user . email "[Email protected]" If there are temporary files, it is not necessary to submit to the branch, you can write the file name or path information in a. gitignore file $echo ' tmp/' >>. Gitignore $echo '. Zfxml ' >>. Gitignore add file to Main branch master and submit $git Add. $git commit-m ' first initialization operation Yo ' if only a few files later, you can add files separately and submit them, such as $git add a.txt b.txt $git commit-m ' Add File txt '
==================================
New branch from master local $git branch Local you can use the command to see if it is successful, where the previous * symbol represents the current branch $git Branch switch Branch to local $git checkout local using GIT branch view If there is a * in front of the local, there is a successful switchover $git branch after the different branches are edited, this time needs to be merged into the Master branch master, this operation needs to be in the master branch $git checkout master $git Merge Local if there is a merge problem, you need to edit it manually, and then do $git add file_name $git commit-m ' xxx ' to delete the merged and useless branch local $git branch-d Local if you need to delete the unincorporated branch , you need to use the-D option, but test it and find that the-D option above also removes the $git of the unincorporated branch branch-d test
Git common commands Click to view