Transferring code from one computer to another through Git

I have a code that I did not pass, and did not click on the branch that I work on on the local computer, because the code still does not work. However, I just want to move this code from one computer to another without affecting the branch. How can I do it? For example, my code is on computer A, and I work with a branch called "develop", with which I retrieve and update the code. I don’t want to change anything in development, but I want to move the code that I wrote to computer B. How do I do this? If anyone could help, that would be great. Thanks!

+4
source share
2 answers

I would create a new branch and introduce it to this branch.

git branch incomplete-code
git checkout incomplete-code
git commit -a
git push origin incomplete-code

Then you can clone the repo on your own computer and work with the incomplete code branch

git clone <repo address>
git checkout incomplete-code

After completing your code, you can merge the branch as such

git checkout develop
git merge incomplete-code

There may be various ways to do this, but this is what I can think of.

+4
source

To transfer using git, you must commit the changes to the local repo on computer A. If you do not want to do this, you just need to copy the changed files from computer A to computer B outside of git.

If both computers have access to the central git repository, which you can do, as others suggest, and transfer the code to a new branch on computer A, push the new branch to the central repo, and then pull the new branch down to computer B.

B A, ( "" A, ) B , A.

, sneakernet, git bundles A B.

A, git format-patch , B git apply .

+1

All Articles