Git can say the project version control required tools, from the fiery GitHub know, ask the net also share a lot of good plug-ins git address, you may not know how to use this, this article on git initialization and customization of the initial directory to explain.
Initializing a project
You need to push the code to a remote repository to initialize the empty warehouse on the remote server
Mkdir/home/git/myapp.git && Cd/home/git/myapp.git
Git–bare Init
Initialization of an empty warehouse
Add a remote repository at the local git warehouse
CD ~/myapp
Git remote add Origin ssh://myserver.com/home/git/myapp.git
At this time, the local. Git/config should change.
Git push Origin Master
To track a local master branch to a remote branch
displaying remote information
git remote show origin
Git rejects the push operation by default and needs to be set up and modified. Git/config Add the following code:
[Receive]
Denycurrentbranch = Ignore
It is best to use Git–bare init when initializing remote warehouses instead of: Git init
If you use GIT init initialization, the remote warehouse directory, also contains work tree, when the local warehouse is pushed to the remote warehouse, if the remote warehouse is on the push branch (if it is not in the push branch, there is no problem), Then the results of the push will not be reflected on the work tree, that is, in the remote Warehouse directory of the corresponding files or previous content, you must use Git reset–hard to see the push content.
It is best to initialize a remote repository with the following command:
Git--bare init
And do not use:
Git init
Customizing the initial Directory
Every time you open git Bush, the default directory is always Windows personal Folders, and then you have to use the command to go to your work directory, it is very troublesome. Later found a way to customize the initial directory of Git, in fact very simple, right click on the desktop Gitbush, right click on the open properties, change the initial location of the directory for your work directory, save