Editing
Move Uncommited Changes In Git To A Different Computer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
On the remote machine, create a branch for transferring the uncommitted changes. <pre> $ git co -b xfer $ git add [changes] $ git commit -m "my message" </pre> On the local machine, add the remote machine as a remote repo. In the command below replace [ALIAS] with the alias for the remote repo. Replace [REMOTE_HOST_ADDR] with the address or host name of the remote computer. <pre> $ git add remote [ALIAS] ssh://[REMOTE_HOST_ADDR]/path/to/repo </pre> Configure both the local and remote computers to use public keys for ssh authorization to avoid entering the ssh password when running git commands. Switch to the `xfer` branch on the local machine and fetch the changes from the remote machine. Replace `[ALIAS]` with the alias from the git add remote command. N.B. `git fetch` retrieves the git metadata describing all of the changes in the repo without copying any files. `git pull` pulls the changed files from the remote. <pre> $ git fetch [ALIAS] </pre> Switch back to the main branch and merge in the changes when the larger set of edits are ready to be incorporated into the project. <pre> $ git co master $ git merge xfer $ git push </pre> [[Category:Git]][[Category:Development]]
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information