Get file from other developer local GIT and add to main repository -


I need to do a simple thing but I can not get it right ...

I and other developers are working with the same GIT branch on the Cloud repository. He added some files with the code which is not well formatted and is not locally committed but did not press the cloud.

I folder those files directly by using my .git git pull I know that at this stage, GIT will make this file a remote branch for me and a local branch to keep this file.

What I can not understand is:

  1. Can I only drag specific files?

  2. How can I add this file to the main branch, am I editing them and then pushing them onto the server?

    BTW: I think that would be to create a temporary branch, push it to my friend machine, drag it to my machine and then It may push the cloud but my workspace does not have a well formatted code, it is problematic ...

    Assuming you can connect to your machine, and git clone its local store, you want to get your branches May include and create a local tracking branch. It looks like you've covered this bit, but for future generations:

      add git remote  Repo & gt; & Lt; His_repo_path & gt;   

    You can not just drag specific files what you can do, your version of your branch is called something unique, and you just have to choose the cherries that you have to finish on your server. Want to:

      git fetch & lt; Repo & gt; & Lt; His_branch & gt ;: throwaway; # This calls your branch 'throave'   

    Suppose its history (like throwaway history) ABCDEF . If you want to command b and D , you can catch them in the main branch with a cherry-picker:

      Git checkout & lt; Main_branch & gt; ; # Check your main branch GT cherry 'B' Jeep Cherry-Pic 'D'   

    And you have done.

    There is also a "quick and dirty" solution I do not recommend because it is bad behavior, but if you really need one or two files, then this work is completed, and you Taking someone from a person who does not command intellectually size:

    1. git checkout-B trashme master; # Or whatever is your main branch
    2. Copy files are literally made copies or sent to you via email.
    3. Take them to the repo, while the trashme branch is checked.
    4. or cherry pick those commits or GIT merge garbage

Comments