How do I update all files from a GIT repository except one specific one?

Asked

Viewed 318 times

3

Using git, you can create the file .gitignore, not to send specific files during the git push origin. I would like to perform the reverse, upload all files except one specific file.

I checked the documentation of git-pull, however, I found nothing related.

How to update git pull origin all files from a git repository, except one specific file?

  • 1

    The last sentence did not match the rest of the question. You want to ignore a folder except a file?

  • By "carry" you mean lower, like during a git clone?

  • 1

    When I mean loading, I mean updating a repository git pull origin, however there are files that I would not like to update.

  • See if this is what you want https://answall.com/questions/193951/como-parar-de-observar-as-mudan%C3%a7as-de-um-determined-file/193957#193957

  • 2

    I believe that there is no way to do this in one command. A workaround would be: 1. git stash -- seu_file # puts your file in a queue 2. git pull # downloads everything 3. git stash pop # returns your file

1 answer

2


To make the git pull origin <branch> without changing any modified file in your local repository, you can perform the following steps:

  1. Save changed files to a queue: git stash
  2. Download the files from the repository: git pull origin <branch>
  3. Return your files: git stash pop

Note: Files that have been changed either remotely or locally will need to be performed merge, if you want to keep the changed file on your machine without performing the merge, just delete them before performing step 3.

More information on the git-stash.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.