How to pull a specific branch from Github

If you did a clone, then all branches should be available to you. You need to checkout the branch. git checkout todo-mvvm-databinding If the branch isn’t available for whatever reason, then you can create it and then pull it: git checkout -b todo-mvvm-databinding (-b specifies “create branch”) git pull origin todo-mvvm-databinding will fetch and merge this branch into … Read more

How to fix HTTP 404 on Github Pages?

Four months ago I have contacted the support and they told me it was a problem on their side, they have temporarily fix it (for the current commit). Today I tried again I deleted the gh-pages branch on githubgit push origin –delete gh-pages I deleted the gh-pages branch on localgit branch -D gh-pages I reinitialized … Read more

How can I delete a file from a Git repository?

Use git rm. If you want to remove the file from the Git repository and the filesystem, use: But if you want to remove the file only from the Git repository and not remove it from the filesystem, use: And to push changes to remote repo

What is the difference between git rm –cached and git reset ?

With git rm –cached you stage a file for removal, but you don’t remove it from the working dir. The file will then be shown as untracked. Take a test drive With git reset <file> you can unstage a file. In the example above you might want to use git reset test to unstage the removal.

Filename too long in Git for Windows

Git has a limit of 4096 characters for a filename, except on Windows when Git is compiled with msys. It uses an older version of the Windows API and there’s a limit of 260 characters for a filename. So as far as I understand this, it’s a limitation of msys and not of Git. You … Read more

Create a tag in a GitHub repository

You can create tags for GitHub by either using: the Git command line, or GitHub’s web interface. Creating tags from the command line To create a tag on your current branch, run this: If you want to include a description with your tag, add -a to create an annotated tag: This will create a local tag with the current state … Read more

What is “origin” in Git?

origin is an alias on your system for a particular remote repository. It’s not actually a property of that repository. By doing you’re saying to push to the origin repository. There’s no requirement to name the remote repository origin: in fact the same repository could have a different alias for another developer. Remotes are simply an alias that store the URL of repositories. You … Read more

How to name and retrieve a stash by name in git?

I was always under the impression that you could give a stash a name by doing git stash save stashname, which you could later on apply by doing git stash apply stashname. But it seems that in this case all that happens is that stashname will be used as the stash description. Is there no way to actually name … Read more