version-only 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 the remote warehouse addressGit push-u Origin Master#Client First CommitGit push-u origin Develop#The local develop branch is submitted to the rem
bbaf6fb5060b4875b18ff9ff637ce118256d6f20, we executed the 'git reset bbaf6fb5060b4875b18ff9ff637ce118256d6f20 ', then the result is only three submitted versions of the A-C.
Differences between git revert and git Reset
Git revert is used to cancel an operation. The commit before this operation will be retained.
Common GIT Commands summaryWith R brother came to the new company (a transition from hardware to the Internet company), the new company's previous code is basically using SVN version control, and even some code is not version control, so called Hg did a git share, ready to put all the company's code
Common git commandsThis article is to learn git when the note excerpt, see: Http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/
To create a version library
Git init
Add Files to Repository
git Add File ...
Some of Git's basic commands
Common git commands
Make sure that you have installed the GIT client
General Configuration
git--version //view git version info
Common Git commands
For the Git basic tutorial, refer to the next article: Git basic tutorial.
Category
Specific commands
Local submission
Initialize the Repository:
branch-D branch name (delete Branch)Git branch-D branch name (Force Delete Branch)Git pull (capture the latest commit)Git Branch -- Set-upstream Dev origin/dev (specify the connection between the local branch and the remote Branch)Git reset head readme.txt (clear readme.txt content in the temporary storage area)
)7) Push Branchgit push Origin master: (pushes content from the master branch locally to the remote Library origin)8) Git Pull: (from a remote crawl branch)12.git Checkout-b DevCreate Branch Dev, equivalent to the following two commands:git branch Devgit checkout dev13.git Checkout Master: (cut back to master branch)14.git
master # Push the local landlord branch to the remote main branch Git push-u Origin Master # pushes the local landlord branch to the remote (if no remote main branch is created for Initialize remote repository Git push Origin Ten, git remote warehouse managementgit remote-v # View remote server address and warehouse name
I use Git every day, but I can't remember many commands.In general, the daily use of just remember 6 commands, you can. But skilled use, I am afraid to remember 60~100 a command.Here's a list of common Git commands I've compiled. Several special nouns are translated as follo
Wen/NanyiI use Git every day, but I can't remember many commands.In general, the daily use of just remember 6 commands, you can. But skilled use, I am afraid to remember 60~100 a command.Here's a list of common Git commands I've compiled. Several special nouns are translated
public key, for did not continue to execute)3.4.2: Locate the file that just saved your public key, open it, and copy the "partial content" in it. Direct. Note, to open the file with a suffix of ". Pub".3.4.3:github add SSH key. See figure RequirementsIt doesn't matter if you fill in a title. Just whatever3.4.4: Download the code locallyRemember the SSH address in the lower-right corner of the "step 3.3" diagram? Now it's time to use it.$ git clone
all changes to the current repos git add [file name] Add a file to git indexgit commit-v When you use the-v parameter you can see the difference of commit git commit-m "This is the message describing the commit" add commit information git commit -A-A is for add, add all the changes to
://zhidao.baidu.com/question/1669154493305991627.html
Some error handling"Pathspec ' branch ' didn't ' match any file (s) known to Git." Errorgit checkout mastergit pullgit checkout New_branchThis error may occur when using Git to submit larger filesError:rpc failed; result=22, HTTP code = 411 fatal:the Remote End hung up unexpectedly fatal:the remote end hung up unexpectedly everythin G up-to-dateIn t
/qiang.git
3.4.1 origin is your repository alias can be changed casually, but please do not conflict with the existing warehouse alias
3.4.2 Warehouse address Generally speaking support
3.5 echo–e "QIANG" >qiang.txt//New Qiang.txt
3.6 git Add Qiang.txt
3.7 git commit–m "add Qiang.txt"
3.8 Git push–u Origin master//push local Qiang warehouse to remote Qiang
3.9 ec
Summarize git version control commands commonly used in daily development and production------------------------------Main--------------------------------Pole Guest Town BuildingTo create a repository$ git clone $ git init #初始化本地版本库Ii. Modification and Submission$
modify someone else's code, we want to see who wrote the particular line of the file, and we can use blame (blame, to hold it accountable).
git blame file
After you execute the above command, each row will show who submitted the specific, and you can flip the page with the paging key.
git command alias settings
Do you think it's a bit troublesome to knock on
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:
[email protected]
and provide relevant evidence. A staff member will contact you within 5 working days.