git-checkout

Visual Studio 2015 Git error message “Cannot pull/switch because there are uncommitted changes”

好久不见. 提交于 2019-12-31 08:34:06
问题 I am having difficulty in doing a pull from origin . I keep getting: "Cannot pull because there are uncommitted changes. Commit or undo your changes before pulling again. See the Output window for details." This also applies to switching branches. I get a similar sort of message, but this does not always happen. I am using Visual Studio 2015 Update 1 and Visual Studio Team Services Git. On my machine I have a local master branch, and development branches. Every time I switch to master and

git checkout master does not switch branch - repository broken?

▼魔方 西西 提交于 2019-12-30 07:54:12
问题 tl;dr : git checkout master does not switch to master branch, gives no error or any output at all and I have no clue why. Any other branch works fine. I have a git repository that consists of the branches development and master . I do a fresh clone of the repository, checking out branch development as default. $ git clone <REPO-URL> --branch development $ git branch -a * development origin/HEAD -> origin/development origin/development origin/master $ git show-ref

How can I print the log for a branch other than the current one?

空扰寡人 提交于 2019-12-30 00:12:24
问题 I'm on a branch with some changes. Changing branch is a pain as some files are locked by processes, so to change branch I'd have to stop all the processes which have locks, then stash the changes before checking out the other branch to see its log. Is it possible to view the log for a different branch, without having to check it out? 回答1: TL; DR Use git log <branch> where <branch> is the name of the branch of interest. From the git-log man-page... A simplified version of the git-log synopsis

Checking out all files in sub directory

扶醉桌前 提交于 2019-12-25 07:35:03
问题 I'm trying to checkout all files and subdirectories in a specific directory "code/app" but git gives me code/app the directory plus its contents. I just want its contents. I would like to use this in a post-receive git hook. git checkout -f master -- code/app I also tried the following to no avail git checkout -f master -- code/app/* git checkout -f master -- code/app/. How can I get the expected behavior stated above? Update: post-receive #!/usr/bin/env ruby # post-receive # Read STDIN from,

Deleting or undoing a push to a remote Git repo

ε祈祈猫儿з 提交于 2019-12-24 19:03:52
问题 I created a remote git repository and proceeded to push code to it from the wrong local repo. The local repo is fine I just want to remove the content I pushed to the remote and start over. I have tried git push origin :master but got an error: ! [remote rejected] master (branch is currently checked out) error: failed to push some refs to 'ssh://................. Is there a simple way of checking it in? 'check in' or 'checking in' (and other variations) produce no relevant results. 回答1:

Checkout old commit from git based on date

倾然丶 夕夏残阳落幕 提交于 2019-12-24 12:25:17
问题 I am trying to retrieve an old commit from git, due to incompatibility with another project (which shares this code). The git repo is OpenZWave. I found a post on SO saying to issue command: git checkout @{14.days.ago} But that results in: warning: Log for '' only goes back to Wed, 23 May 2018 08:02:05 -0400. HEAD is now at 77a05ed... Update hs-ms100plus.xml I can't figure out what's wrong - clearly there are older commits than today's date. What is wrong with this command? (And will that

GIT: When checking out an alternative branch, I want to clear ignored files

巧了我就是萌 提交于 2019-12-24 08:28:42
问题 Assume I have a structure in master. d - src - main ... - resources ... - target - xyz Files xyz should not be tracked, so I added into .gitignore target/* and commit the structure git commit -m 'initial structure' I create 2 branches git branch t1 git branch t2 and switch to t1 git checkout t1 I start doing some work, compile stuff, such that target is populated. I commit my changes to t1. git commit -a 't1 specific changes' then I switch to t2 git checkout t2 When I look into target, it is

Going back to previous commit in SourceTree

谁说胖子不能爱 提交于 2019-12-23 13:00:58
问题 I am new to Git, and I was trying to revert back to a previous commit in SourceTree. I right clicked on the commit I was going to revert to and then clicked checkout. It gave me a prompt saying that my working copy would become a detached head. What does this mean and is this something I should avoid? 回答1: As Per Git-Tower's Article : What's a "detached HEAD" in Git? Understanding how "checkout" works With the "git checkout" command, you determine which revision of your project you want to

error: git checkout-index: unable to create file

痞子三分冷 提交于 2019-12-22 01:46:06
问题 What I am trying to do is a git clone on windows, but the parent repository exists in a unix machine. Am cloning using ssh to get a clone from UNIX to windows, and I get this weird error. error: git checkout-index: unable to create file <filename> This happens during the checkout step of a git clone. Can anyone help me? 回答1: The answer should be:we can't create a file named aux.c in windows! See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx Do not use the

What controls git checkout feedback?

爷,独闯天下 提交于 2019-12-21 16:57:41
问题 Sometimes a git checkout command gives progress feedback: $ git checkout develop Checking out files: 100% (10779/10779), done. Switched to branch 'develop' Sometimes it doesn't, (very next command line, same repo context): $ git checkout master Switched to branch 'master' It's not because the branches are equal, because switching back on the very next command shows this feedback: $ git checkout develop Checking out files: 47% (5067/10779), done. Switched to branch 'develop' This happens for