What is the Difference Between Mercurial and Git?
2022-05-17
Question Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. </div> I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git.…
Remove local git tags that are no longer on the remote repository
2022-05-16
Question We use tags in git as part of our deployment process. From time to time, we want to clean up these tags by removing them from our remote repository. This is pretty straightforward. One user deletes the local tag and the remote tag in one set of commands. We have a little shell script that combines both steps. The 2nd (3rd, 4th,...) user now has local tags that are no longer reflected on the remote.…
What's the difference between git switch and git checkout
2022-05-16
Question Git 2.23 introduces a new command git switch -- after reading the docs, it seems pretty much the same as git checkout <branchname> can someone explain the difference or use case? Two new commands "git switch" and "git restore" are introduced to split "checking out a branch to work on advancing its history" and "checking out paths out of the index and/or a tree-ish to work on advancing the current history"…
How to convert existing non-empty directory into a Git working directory and push files to a remote repository
2022-05-15
Question I have a non-empty directory (eg /etc/something) with files that cannot be renamed, moved, or deleted. I want to check this directory into git in place. I want to be able to push the state of this repository to a remote repository (on another machine) using "git push" or something similar. This is trivial using Subversion (currently we do it using Subversion) using: svn mkdir <url> -m <msg> cd <localdir> svn co <url> .…
Why is a git 'pull request' not called a 'push request'?
2022-05-15
Question The terminology used to merge a branch with an official repository is a 'pull request'. This is confusing, as it appears that I am requesting to push my changes to the official repository. Why is it called a pull request and not a push request? Answer If you have a code change in your repository, and want to move it to a target repository, then: "Push" is you forcing the changes being present in the target repository (git push).…
What Git branching models work for you?
2022-05-14
Question Our company is currently using a simple trunk/release/hotfixes branching model and would like advice on what branching models work best for your company or development process. Workflows / branching models Below are the three main descriptions of this I have seen, but they are partially contradicting each other or don't go far enough to sort out the subsequent issues we've run into (as described below). Thus our team so far defaults to not so great solutions.…
Why do I need to do `--set-upstream` all the time?
2022-05-14
Question I create a new branch in Git: git branch my_branch Push it: git push origin my_branch Now say someone made some changes on the server and I want to pull from origin/my_branch. I do: git pull But I get: You asked me to pull without telling me which branch you want to merge with, and 'branch.my_branch.merge' in your configuration file does not tell me, either. Please specify which branch you want to use on the command line and try again (e.…