git-branch

How is a tag different from a branch in Git? Which should I use, here?

試著忘記壹切 提交于 2019-11-26 02:28:28
I am having some difficulty understanding how to use tags versus branches in git . I just moved the current version of our code from cvs to git , and now I'm going to be working on a subset of that code for a particular feature. A few other developers will be working on this as well, but not all developers in our group are going to care about this feature. Should I be creating a branch or a tag? In what situations should I be using one versus the other? tvanfosson A tag represents a version of a particular branch at a moment in time. A branch represents a separate thread of development that

Rename master branch for both local and remote Git repositories

回眸只為那壹抹淺笑 提交于 2019-11-26 02:22:31
I have the branch master which tracks the remote branch origin/master . I want to rename them to master-old both locally and on the remote. Is that possible? For other users who tracked origin/master (and who always updated their local master branch via git pull ), what would happen after I renamed the remote branch? Would their git pull still work or would it throw an error that it couldn't find origin/master anymore? Then, further on, I want to create a new master branch (both locally and remote). Again, after I did this, what would happen now if the other users do git pull ? I guess all

Branch from a previous commit using Git

て烟熏妆下的殇ゞ 提交于 2019-11-26 02:22:09
If I have n commits, how can I branch from the n-3 commit? I can see the hash of every commit. CB Bailey You can create the branch via a hash: git branch branchname <sha1-of-commit> Or by using a symbolic reference: git branch branchname HEAD~3 To checkout the branch when creating it, use git checkout -b branchname <sha1-of-commit or HEAD~3> OneSolitaryNoob To do this on github.com: Go to your project. Click on the "Commits". Click on the <> ("Browse the repository at this point in the history") on the commit you want to branch from. Click on the "tree: xxxxxx" up in the upper left. Just below

Showing which files have changed between two revisions

安稳与你 提交于 2019-11-26 02:17:51
I want to merge two branches that have been separated for a while and wanted to know which files have been modified. Came across this link: http://linux.yyz.us/git-howto.html which was quite useful. The tools to compare branches I've come across are: git diff master..branch git log master..branch git shortlog master..branch Was wondering if there's something like "git status master..branch" to only see those files that are different between the two branches. Without creating a new tool, I think this is the closest you can get to do that now (which of course will show repeats if a file was

Modified files in a git branch are spilling over into another branch

流过昼夜 提交于 2019-11-26 01:53:56
问题 I am working on a git repository with a master branch and another topic branch. I have switched to topic branch and modified a file. Now, if I switched to master branch that same file is shown as modified. For example: git status in git-build branch: # On branch git-build # Changes to be committed: # (use \"git reset HEAD <file>...\" to unstage) # # modified: cvsup_current # Switch to master branch [root@redbull builder_scripts (git-build)]# git co master M builder_scripts/cvsup_current

Difference between git checkout --track origin/branch and git checkout -b branch origin/branch

南楼画角 提交于 2019-11-26 01:52:21
问题 Does anybody know the difference between these two commands to switch and track a remote branch? git checkout -b branch origin/branch git checkout --track origin/branch I think both keep track of the remote branch so I can push my changes to the branch on origin, right? Is there any practical differences?? Thanks! 回答1: The two commands have the same effect (thanks to Robert Siemer’s answer for pointing it out). The practical difference comes when using a local branch named differently : git

How is a tag different from a branch in Git? Which should I use, here?

ぃ、小莉子 提交于 2019-11-26 01:50:10
问题 I am having some difficulty understanding how to use tags versus branches in git. I just moved the current version of our code from cvs to git, and now I\'m going to be working on a subset of that code for a particular feature. A few other developers will be working on this as well, but not all developers in our group are going to care about this feature. Should I be creating a branch or a tag? In what situations should I be using one versus the other? 回答1: A tag represents a version of a

Showing which files have changed between two revisions

做~自己de王妃 提交于 2019-11-26 01:47:57
问题 I want to merge two branches that have been separated for a while and wanted to know which files have been modified. Came across this link: http://linux.yyz.us/git-howto.html which was quite useful. The tools to compare branches I\'ve come across are: git diff master..branch git log master..branch git shortlog master..branch Was wondering if there\'s something like \"git status master..branch\" to only see those files that are different between the two branches. Without creating a new tool, I

Branch from a previous commit using Git

主宰稳场 提交于 2019-11-26 01:09:36
问题 If I have n commits, how can I branch from the n-3 commit? I can see the hash of every commit. 回答1: You can create the branch via a hash: git branch branchname <sha1-of-commit> Or by using a symbolic reference: git branch branchname HEAD~3 To checkout the branch when creating it, use git checkout -b branchname <sha1-of-commit or HEAD~3> 回答2: To do this on github.com: Go to your project. Click on the "Commits". Click on the <> ("Browse the repository at this point in the history") on the

Rename master branch for both local and remote Git repositories

南楼画角 提交于 2019-11-26 01:02:39
问题 I have the branch master which tracks the remote branch origin/master . I want to rename them to master-old both locally and on the remote. Is that possible? For other users who tracked origin/master (and who always updated their local master branch via git pull ), what would happen after I renamed the remote branch? Would their git pull still work or would it throw an error that it couldn\'t find origin/master anymore? Then, further on, I want to create a new master branch (both locally and