It is possible to do (in the deployed repository)
git fetch git checkout origin/master -- path/to/file
The fetch will download all the recent changes, but it will not put it in your current checked out code (working area).
The checkout will update the working tree with the particular file from the downloaded changes (origin/master
).
At least this works for me for those little small typo fixes, where it feels weird to create a branch etc just to change one word in a file.
Related Posts:
- How do I check out a remote Git branch?
- What is git tag, How to create tags & How to checkout git remote tag(s)
- How do I revert a Git repository to a previous commit?
- How can I switch to another branch in git?
- How to get just one file from another branch?
- How do I revert a Git repository to a previous commit?
- How do I revert all local changes in Git managed project to previous state?
- How do I revert all local changes in Git managed project to previous state?
- How can I reset or revert a file to a specific revision?
- What’s the difference between git switch and git checkout
- git checkout tag, git pull fails in branch
- git checkout master error: the following untracked working tree files would be overwritten by checkout
- Git checkout – switching back to HEAD
- git checkout all the files
- What does ‘–set-upstream’ do?
- What does ‘–set-upstream’ do?
- How to use Git Revert
- How do I properly force a Git push?
- How to remove local (untracked) files from the current Git working tree
- Git merge hotfix branch into feature branch
- Git submodule update
- What does ‘git merge –abort is equivalent to git reset –merge when MERGE_HEAD is present.’ of Git merge man page mean?
- How to modify existing, unpushed commit messages?
- Git pushing to remote branch
- How to revert a merge commit that’s already pushed to remote branch?
- GitHub Error Message – Permission denied (publickey)
- How do I push a new local branch to a remote Git repository and track it too?
- How do you push a tag to a remote repository using Git?
- Remove files from Git commit
- Gitignore not working
- How to solve SSL certificate: self signed certificate when cloning repo from github?
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- How to revert multiple git commits?
- How do I rename both a Git local and remote branch name?
- How do I fix a Git detached head?
- How to cherry-pick multiple commits
- Another git process seems to be running in this repository
- rejected master -> master (non-fast-forward)
- merge one local branch into another local branch
- Move the most recent commit(s) to a new branch with Git
- What does “Git push non-fast-forward updates were rejected” mean?
- How do I diff the same file between two different commits on the same branch?
- You have not concluded your merge (MERGE_HEAD exists)
- How to get the current branch name in Git?
- Git error on commit after merge – fatal: cannot do a partial commit during a merge
- Can I share my private GitHub repository by link?
- Is there a “theirs” version of “git merge -s ours”?
- How to rename a directory/folder on GitHub website?
- Create a git patch from the uncommitted changes in the current working directory
- git push says “everything up-to-date” even though I have local changes
- Is there a “git touch” so I can push the same file with a new timestamp?
- Branch from a previous commit using Git
- How to create a .gitignore file
- How do I rename a repository on GitHub?
- Hard reset of a single file
- Not a valid object name: ‘master’
- git: fatal: Could not read from remote repository
- Why does git say “Pull is not possible because you have unmerged files”?
- How to see the changes between two commits without commits in-between?
- Git: Installing Git in PATH with GitHub client for Windows
- How to delete a stash created with git stash create?
- How do I copy a version of a single file from one Git branch to another?
- Undo a git stash
- Undo git stash pop that results in merge conflict
- Git: cannot checkout branch – error: pathspec ‘…’ did not match any file(s) known to git
- Set up git to pull and push all branches
- Invalid VCS root mapping – 3 errors on my project
- Unity Collaborate vs GitHub
- “fatal: HttpRequestException encountered.” Error with GitHub/Bitbucket Repositories due to dropping TLS-1.0 support
- SourceTree keeps asking for Github password
- Git’s local repository and remote repository — confusing concepts
- How to change the license for a project at Github?
- How do i git push specific branch?
- Git add all files modified, deleted, and untracked?
- How to switch back to ‘master’ with git?
- fatal: could not read Username for ‘https://github.com’: No such file or directory
- Github Authentication Failed – … GitHub does not provide shell access
- How do I pull files from remote without overwriting local files?
- How can I see which Git branches are tracking which remote / upstream branch?
- How to keep a branch synchronized/updated with master?
- TortoiseGit-git did not exit cleanly (exit code 1)
- How to `git pull` while ignoring local changes?
- Your repository has no remotes configured to push to
- Uninitialize git repository
- Specify an SSH key for git push for a given domain
- How do I “un-revert” a reverted Git commit?
- How to create a local branch from an existing remote branch?
- git push not send changes to remote git repository
- How to merge a specific commit in Git
- What is the .git folder?
- How to use Git and Dropbox together?
- Git: Where exactly is the “working directory”?
- What exactly does the “u” do? “git push -u origin master” vs “git push origin master”
- Updating and committing only a file’s permissions using git version control
- What is the usual process of saving changes made at the CMS level into source control?
- Collaboratively develop a WordPress site
- Add latest commit info on login footer using login_footer hook
- WordPress Core files not being ignored by Git
- Display GitLab repositories of the logged in user on a page
- Full site editor, hard-coded IDs in query blocks, and staging/dev servers