your project to the remote Web repository.Of course, we may sometimes have to copy from GitHub and make changes, and we can use git clone [email protected]:username/git-demo.git Copy to commit after the change. The illustration showsOf course, our teammates may have to submit new changes before we can use git pull to synchronize remotely, and then make changes on a new basis.At this point a complete git process is gone. git checkout-b to create a branch and jump, you can do the normal devel
. fallback$ git reset HEADDiscard staging Area changes, undo staging area's changes (Unstage), and re-return to the workspace$ git Reset--Hard head abandons the workspace and index changes, and the head pointer still points to the current commit. Undo the merge without commit, in fact the principle is to abandon the index and workspace changes, Because no commit changes exist only in the index and workspace. $ git reset--hard head^ is used to undo the contents of the commit (equivalent to git re
version number:Git reflogIgnore fileCreate a. gitignore file (named. gitignore in Windows).In the list of files and directories you don't want Git to track#例外的文件类型*.exe#例外的文件夹testdir/#例外文件 (not backed up)!my.pycBranch Management#新建分支:GIT branch Switch branches (preferably commit changes before, or stashing, or commit amending):git checkout New and switch to branchGit checkout-b # Merging the develop branches (with the--no-ff attribute, the child nodes of the merged branch all fit together)git m
normal mode, the merged history has branches, can be seen to have been merged, andfast forwardThe merger would not have been seen as a merger.$ git merge--no-ff-m "merge with No-ff" Devmerge made by the ' recursive ' strategy. Readme.txt | 1 + 1 file changed, 1 insertion (+)13.When fixing a bug, we will fix it by creating a new bug branch, then merging and finally deleting;When the work is not finished, first put the job site git stash , and then
$ git diff (1)$ git diff--cached (2)$ git diff HEAD (3)git differ # # S and W ratio togit diff--staged # # S and H comparisongit diff HEAD # # W and H comparisongit diff--stat HEAD # dittoUndo Error:git reset file1 # # recover from H to Sgit checkout file1 # # recover from S to Wgit checkout HEAD # # recover from H to WRemove and rename:git rm file1 # removed from W and S, deleted from H when committedgit rm--cached file1 #从 S Deletegit mv file1 file2 # renamed from W and S, commit takes effectg
Git Proxy: Set up proxygit config--global http.proxy proxy addressRepository Clonegit clone git addressgit checkout BranchnameWork Flow:1. Create a new branch for a feature on it, preferably on a remote repository-create locally to choose which branch to base on 2.add These changes to stage-- Select in Sourcetree to add files directly to the stage 3. temporarily modify git stash 4. switch back to the main branch update code git checkout devel
/refs/tags/old_practiceAfter you take a photo, you can execute the git describe command to display the latest commit as an easy-to-remember name.The most recent milestone from the submission is selected as the "base version number", followed by the identity distance "base version"and an abbreviation for the SHA1 hash value of the commit. Because the latest submission was hit by a "milestone".So the name of the milestone is displayed directly. This technique is often used in the following example
whatchanged # show file changes for commit history the git revert dfb02e6e4f2f7b573337763e5c0013802e392818 # Undo Commit dfb02e6e4f2f7b573337763e5c0013802e392818 -Git ls-Tree HEAD # internal command: Show a Git object inGit rev-parse v2.0# Internal command: Displays a ref for the SHA1 HASH the git Reflog # shows all commits, including orphaned nodes thegit show [email protected]{5} About git show [email protected]{yesterday} # shows the status of the Master branch yesterday thegit log--pretty=f
information for each branchgit br--merged # View branches that have been merged into the current branchgit br--no-merged # View branches that have not been merged into the current branchGit Co Git co-b git co-b Git Co $id # Checkout A history commit record, but without branching information, switching to another branch will automatically deleteGit co $id-B git br-d git br-d Branch Merging and Rebasegit merge git merge origin/master--no-ff # do not fast-foward merge so you can generate a merge c
Remote Branchgit br Git br-v # View the last commit information for each branchgit br--merged # View branches that have been merged into the current branchgit br--no-merged # View branches that have not been merged into the current branchGit Co Git co-b git co-b Git Co $id # Checkout A history commit record, but without branching information, switching to another branch will automatically deleteGit co $id-B git br-d git br-d Branch Merging and Rebasegit merge git merge origin/master--no-ff # do
Suppose you are currently working on the Dev branch, but you need to fix the bug right away, how do you handle it?Since the work of Dev is not yet completed, it cannot be submitted,1, use the git stash command to save the current job site, and so on after the recovery site to continue to work.Git stash2, assuming the bug is on the master branch, create a temporary branch from mastergit checkout MasterGit checkout-b issue-1013, modify the bug, then add
Library
Git checkout-B devCreate a dev branch and switch to the dev branch.
Git branchView all current branches
Git checkout masterSwitch back to master Branch
Git merge devMerge dev branches on the current Branch
Git branch-d devDelete dev Branch
Git branch nameCreate Branch
Git stashHide the current job and resume the job after the job is resumed.
Git stash listView the list of all hidden files
Git stash
to partition 2. View the branch that is currently pointing:git branch lists all the branches, and the branch that is currently pointing to has more than one * 3, switch branch is git checkout branchname 4. Merge branch:git merge branchname merge branchname to current branch 5. Delete branch:git branch-d branchname delete branchname BranchNote: creating, merging, and deleting branches is fast, andgit encourages the use of branching to accomplish a task, deleting the branch after merging, and
resolution (Updated upstream and = = between the content is pull down, if you do not need to delete, you can delete the local line)Git stash (staging local content)Git pullgit stash pop stash@{0}{stash@{0} modify the tag to restore the staging content}Delete Branch (provided that the branch being deleted is not the cu
Use PHP to automatically deploy GIT code and php to deploy git. Using PHP to automatically deploy GIT code, php to deploy git is using Coding code hosting recently, and WebHook automatic deployment is set by the way, the process is still quite difficult, I still don't understand Linux permissions. I can use PHP to automatically deploy GIT code, and use php to deploy git.
Recently, we are using Coding code hosting. By the way, we have set up automatic WebHook deployment. this process is still qu
introduction to Sourcetree, after all, the use of git in China is not common sourcetreeAs a lazy git command line I don't really love it so the GUI tools become my first choiceThe GIT tools under Mac are a lot of famous tower smartgit and so on (more on the introduction here)Today we are introducing Sourcetree for Atlassian products and the famous track tool Jira GitHub competitor BitBucket and so on (these two I also often use, especially
Use PHP to automatically deploy git code, PHP to deploy git
Recently in the use of coding code hosting, the way to set up the Webhook automatic deployment, the process is very difficult, mainly still do not understand the rights of Linux control, but fortunately, to share the most benefit of an article for your reference, the original English version, my English is not, barely able to read , let's see.
Original link: http://jondavidjohn.com/git-pull-from-a-php-script-not-so-simple/
I intended
Github/bitbucketGitHub is a git-based code hosting platform, where paid users can build private warehouses, and our general free users can only use public repositories, which means the code is open.GitHub website address:https://github.com/. Then you can create the warehouse (free users can only build public warehouses)https://bitbucket.orgBitBucket is a Web site that provides web hosting services for projects that use mercurial and GIT version control systems.
code, and automatically complete the analysis, but also set up scheduled tasks, to achieve full-automatic, is a necessary tool for lazy people ah!In the following example, the source code is automatically analyzed using Git+scanner and Git+maven respectively. Basically, the first thing to do is to have a code base, such as BitBucket, and then configure Git to automatically download the latest code from the codebase in Jenkins, and finally call scanne
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.