(1) Download first
git clone URL
(2) Switch to branch Jarsample
git checkout Jarsample
(3) Download the code from the master branch of the remote Origin repository to the local Origin jarsample
Git fetch Origin Jarsample
(
There are 2 commands in git that get the latest version from the remote branch to the Local:
git fetch: The equivalent of getting the latest version from remote to local, not automatically merge
--global user.email "[Email protected]"7. Submit ChangesUse the command git add * to commit all changes to the cache (local), waiting to be sentUse the command git commit-m "Modify information" to submit the changes to head (local) and describe what modifications were made8. Commit changes to the remote serverUse the command
1. Create local branch Local_branch
Git branch Local_branch
2. Create local branch Local_branch and switch to Local_branch branch
Git checkout-b local_branch
3. Switch to Branch Local
the modified files need to be submitted before switching branches
1. Switch branches
Git checkout-b branchname to create a branch locally and switch to that branch
V. Merging of branches
1. Merge the Branch (Branchname) in development into the main branch (Otherbranchname)
About the remote branch-My understanding: The remote branch is always the latest version of the store.If the remote branch has been modified by someone else and its version is higher than the local version, you need to pull the
newest location ( See figure 3-24).
Figure 3-24.The git fetch command updates the remote index。To demonstrate how a project with multiple remote branches (on different remote servers) works, let's say you have another internal server that is only available to your Agile development team git.team1.ourcompany.com
The previous article introduced Git's local basic operations, if you don't need to collaborate with others, such as writing a book yourself, writing a small program yourself, writing a website, and so on, it's almost enough. but sharing and collaboration is the theme of the free world, and Git is born for it, so try to be a student who loves to share and collaborate. ^_^The Git repository concept can be und
1, create a new branch from an existing branch (such as from the Master branch), create a dev branchgit checkout-b Dev2, can be viewed once created, branch has switched to DevGit branch* DevMaster3, submit the branch to the
When clone finishes the repository and switches to the development branch, a hint appears after using Git pull-r to pull and merge branches:$ git pull-rFrom Ssh://192.168.1.226:29418/ethank-serverBc86d14. B72fc88 Dev-and Origin/devThere is no tracking information for the current branch.Please specify which branch the w
Master Branch and Dev branch already on GitHubOn a localgit checkout-b dev new and switch to local dev branchGit pull Origin dev local branch associated with remote branch========================================================================================================
objects:92, done.
Delta compression using up to 4 threads.
Compressing objects:100% (48/48), done.
Writing objects:100% (58/58), 1.38 MiB, done.
Total (delta), reused (Delta 5)
To Git@github.com:zrong/quick-cocos2d-x.git
* [New Branch] Develop-> develop
However, when I was working on the GitHub, I encountered this error while removing the remote
Generally we publish a new version to the online server will be a tag in the repository, so we can always view the tag version, that is, the tag is actually a snapshot in the repository. A git tag is similar to a branch, except that the branch is mutable and the label is immutable. Next we show you how to get the versi
Sometimes git clones come down with a lot of branch, and the trouble is that if the main branch doesn't have code then you can only see the. git directory. As in the following:$ git clonegit://gitorious.org/android-eeepc/mesa.gitDiscover that there is only one.
automatically switches to the develop branch. 3. synchronize local remote branches:
1
$: git fetch origin
4. Submit the branch data to the remote server:
1
$: git push origin
For example:
Application Scenarios
Two people in the team fetch a branch at the same time. The first person changes after the submission, the second person submits the failure. The failure information is as follows:
Error:failed to push some refs to ' git@git.oschina.net:jacarrichan/jacarrichan.git '
hint:updates were rejected Beca Use the remote contains work, which you do
H
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:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.