Git Tag Branch

//git setting
git help log
git config --global user.name "patrick"
git config --global user.email ""

git init
git add .

View the historical status of the current branch
git show HEAD

Compare two versions
git diff HEAD VersionID Go

back to the version
git reset --hard HEAD^ Go back to the specified version and clear the information after the revision
git reset HEAD^ Go back to the specified version and submit a new

version Search from the specified version
git grep "for new logic " v1.5
git log v1 .4..v1.5
git log v1.5..
git log --since='2 weeks ago' Commit information two weeks ago

//Development branch strategy
View remote branch
git branch -a

Delete remote branch and tag
git push origin --delete banchname

git push origin --delete tag tagname
or
git push origin:branchname

git tag -d tagname
git push origin:refs/tags/tagname

Delete the local branch corresponding to the remote branch that does not exist
git checkout b1
Check the code status of b1
git remote show origin
If you see stale, use
git remote prune origin
or
git fetch -p

to rename the remote branch ( change devel to develop)
git branch -av

delete remote branch
git push --delete origin devel
rename local branch
git branch -m devel devlop
push local
git push origin develop


create a develop branch
git checkout -b devlop master

switch master
git checkout master

Merge the develop branch
git merge --no-ff develop (fast-forward merge)
http://sandofsky.com/blog/git-workflow.html

branch strategy
   * feature branch

  * pre-release (release) branch

  * Fix bug (fixbug) branch

Create a feature branch
git checkout -b feature-x develop
git checkout develop
git merge --no-ff feature-x

delete feature branch
git branch -d feature-x

Create a pre-release branch
git checkout - b release-1.2 develop
git checkout master
git merge --no-ff release-1.2

tag the Master
git tag -a 1.2


create a patch bug branch
git checkout -b fixbug-0.1 master
git checkout master
git merge --no-ff fixbug-0.1
git tag -a 0.1.1

is merged into the develop branch
git checkout develop
git merge -no-ff fixbug-0.1

To delete the patch bug branch
git branch -d fixbug-0.1


//tag usage
If the tag name is 1.0, you can Export as follows
1. Export and compress to zip format
git archive --format=zip --output=v1.0.zip 1.0

2. Export and compress to tar.bz2 format
git archive 1.0 | bzip2 >v1.0.tar.bz2

3. Export and compress to tar.gz format
git archive --format=tar 1.0 | gzip > v1.0.tar.gz

4. View existing tags
git tag -l 
git tag -l 'v1.4.*'

5. Switch to a tag
git checkout tag_name

from tag creates a branch
git checkout -b branch_name tag_name

6. Add tag
git tag -a v1.5 -m 'release 1.5'

7. View a tag
 git show v1.5

8. Sign the tag
git tag -s v1.5 - m 'my signed 1.5 tag'

9. Verify the tag
git tag -v v1.5

10. Add the tag later
git log --pretty=oneline

11. Submit the code and forget to type the version number
git tag -a v1.5 9fceb02

12. Submit Tags
git push origin v1.5
git push origin --tags

13. Get remote tag
git fetch origin tag v1.5


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326337792&siteId=291194637