The company decided to build its own git server managed code, today I am ready to submit, found some problems to share with you.
First, how to install Git to Mac OS X
Before installing, git, like SVN, needs to create a server that can create its own version Management Server. For individuals and small teams, it may be more appropriate to use a managed server,
Common to have GitHub and bitbucket. Here I introduce the next bitbucket,github because there is no personal free warehouse use, the code put up is open source, so here I choose BitBucket. In addition, now BitBucket's personal warehouse related pages have been basically Chinese. The registration process is also relatively straightforward.
See links; https://bitbucket.org/
Here is the first introduction to using command-line.
1, download git installer, address; http://git-scm.com/downloads
2, open after download, double-click. PKG Installation
3, open the terminal, use the git--version command to view the installation version, there is a successful installation
/* The following 4.5 commands are automatically included if they have already been created using BitBucket */
4, create a global user name
git config--global user.name "first_name last_name"
5, create a global mailbox
git config--global user.email "[email protected]"
6, if you do not want to enter the remote repository each time the password, enter the following command
Git credential-osxkeychain
------> Wait
git config--global credential.helper osxkeychain
# Set git to use the Osxkeychain credential helper
The installation is complete at this git.
Then, let's take a look at how to use
With the command line of the terminal, we must first have some knowledge of the Linux command lines. The actual use of the less often used, here only to introduce some necessary.
Reference link; http://www.renfei.org/blog/mac-os-x-terminal-101.html
Linux basic commands;
Sudo-sget absolute User Rights
cd XXXEnter the XXX directory
LS (-a/-a)Show all files under current path (hidden)
PwdShow current absolute path
mkdir xxxCreate folder xxx
Mans XXXView the XXX command manual
Then introduce the meaning of the git basic command;
Clonecloning a remote repository
InitInitializing the Warehouse
Remoteconnecting to a remote repository
Pullget new data from the remote repository drop-down
Pushupload new or modified files from the local repository to the remote repository
Addadd files or modify files, commit and push before using
Loglog information submitted by the current warehouse
StatusCurrent Warehouse version status
Commitcommit to the current warehouse
Branchbranch commands, related additions and deletions check operation
Checkoutuse the last version of the remote repository to completely overwrite the current warehouse content/Select Branch Branch
DiffCompare version Content
MergeMerge version Content
See links in detail; Https://confluence.atlassian.com/display/BITBUCKET/Bitbucket+Documentation+Home,
Initialize with Git init.
Finally, after the local directory is linked to the remote repository (the Clone command), use the following method to manipulate the file.
git add xxx Add or to modify the xxx file
------------------>
git commit-m "Adding repo instructions" submit the xxx file to the local repository version;-M "XXXX"; commit log
------------------>
Git push-u origin master submits xxx and log under the master branch of the Remote repository origin (the alias of the remote Repository repository just created)
Note: Since the x-code itself has git tools, we need to remove the. Git, which X-code comes with.
That's OK!
IOS Development to submit code to your own company git server