Git build team development environment operation Drill
Simulate remote git repository Creation
1. First create the following directory structure:
/Users/Hutch/Desktop/GitTest2/GitServer/weibo
Weibo is the project we want to create.
2. Switch the Directory
$ Cd/Users/hujh/Desktop/GitTest2/GitServer/weibo
3. Create a blank code library (dedicated for Team Development)
$ Git init-bare
Normally, the following result is displayed, indicating that the empty warehouse is successfully initialized.
Initialized empty Git repository in/Users/Hutch/Desktop/Git walkthrough/GitServer/weibo/
Project Manager initializes Local warehouse
1. The project manager creates the following directory structure:
/Users/Hujia/Desktop/GitTest2/Manager
2. Switch the Directory
$ Cd/Users/Hujia/Desktop/GitTest2/Manager/weibo
3. "clone" the code library to the local device.
$ Git clone/Users/Hutch/Desktop/GitTest2/GitServer/weibo/
The displayed result is as follows:
Cloning into 'weibo '...
Warning: You appear to have cloned an empty repository.
Done.
Indicates that the repository is successfully cloned. You can access the weibo directory
The result shown in ls-la is as follows:
There is a. git Directory, which is the hidden directory of the repository.
4. Personal information configuration (because you want to demonstrate multi-person collaboration on a machine, daily development can be ignored)
$ Git config user. name manager
$ Git config user. email manager@163.com
5. Add the. gitignore file to specify which files are not included in the version library management.
Reference: https://github.com/github/gitignore
1) paste and execute the following command in the same-level directory of the. git directory
Echo-e "# Xcode
#
Build/
*. Pbxuser
*. Mode1v3
*. Mode2v3
*. Perspectivev3
Xcuserdata
*. Xccheckout
*. Moved-aside
DerivedData
*. Hmap
*. Ipa
*. Xcuserstate
# CocoaPods
#
# We recommend against adding the Pods directory to your. gitignore. However
# You shoshould judge for yourself, the pros and cons are mentioned:
# Http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Pods/">. gitignore
2) check through ls-la. A. gitignore file is generated.
3) run the following command to add. gitignore to the code base:
$ Git add. gitignore
$ Git commit. gitignore-m "Add. gitignore to ignore Files"
6. Create an initialization Project
Use Xcode to Create a project under the weibo directory. Note that the Create Git repository tab is grayed out when the Save address is selected to enter the weibo directory.
After writing and modifying the code, select Source Control ---> Commit to submit our code:
In the displayed interface, perform operations. Refer to the instructions in the figure below:
I did not select automatic push. To save time in project development, you can select this option. Here, it is not checked to show you how to manually push: Select SourceControl --> push
Then click push
If the push is successful, the push successful is displayed, which means the push is successful to the remote repository.
Now, the project manager has initialized the project warehouse.
Employee jackie started development projects
Create employee jackie directory
/Users/Hutch/Desktop/GitTest2/jackie
2. Go to the employee jackie directory.
Cd/Users/Hujia/Desktop/GitTest2/jackie
3. "clone" the code library to the local device.
$ Git clone/Users/Hutch/Desktop/GitTest2/GitServer/weibo/
You can see the project file in the jackie directory.
Then you can develop the project.
GitHub Tutorials:
GitHub tutorials
Git tag management details
Git branch management
Git remote repository details
Git local Repository (Repository) Details
Git server setup and Client installation
Git Overview
Share practical GitHub tutorials
How to Build and use Git servers in Ubuntu
Git details: click here
Git: click here
This article permanently updates the link address: