D*********s 发帖数: 555 | 1 我就想干个简单的事情
1,sync with a GIT repo
2. 保留一两个我的local change不被覆盖
我不需要commit, one way sync就好,现在发现很麻烦,这个git还真是得需要
学习,不过我 懒得花时间了。 |
wy 发帖数: 14511 | 2
git pull?
use branch
【在 D*********s 的大作中提到】 : 我就想干个简单的事情 : 1,sync with a GIT repo : 2. 保留一两个我的local change不被覆盖 : 我不需要commit, one way sync就好,现在发现很麻烦,这个git还真是得需要 : 学习,不过我 懒得花时间了。
|
D*********s 发帖数: 555 | 3 看来你也不会
【在 wy 的大作中提到】 : : git pull? : use branch
|
wy 发帖数: 14511 | 4 你zkss
【在 D*********s 的大作中提到】 : 看来你也不会
|
m******t 发帖数: 2416 | 5
Use 'git clone' to clone the repo.
For your local changes (assume you are on master):
$ git checkout -b local
Now you can make your local changes and commit them to
this new local branch. Also work on this branch all the time.
Now when you need to pull down new changes, do:
$ git fetch remote
$ git rebase remote/master master
$ git rebase master local
On the last step above you might have some conflicts
if your local changes involve the same files in the new
upstream changes. You'll need to r
【在 D*********s 的大作中提到】 : 我就想干个简单的事情 : 1,sync with a GIT repo : 2. 保留一两个我的local change不被覆盖 : 我不需要commit, one way sync就好,现在发现很麻烦,这个git还真是得需要 : 学习,不过我 懒得花时间了。
|
D*********s 发帖数: 555 | 6 谢谢,我正在clone,然后照你的试试。
【在 m******t 的大作中提到】 : : Use 'git clone' to clone the repo. : For your local changes (assume you are on master): : $ git checkout -b local : Now you can make your local changes and commit them to : this new local branch. Also work on this branch all the time. : Now when you need to pull down new changes, do: : $ git fetch remote : $ git rebase remote/master master : $ git rebase master local
|
D*********s 发帖数: 555 | 7 #git fetch remote
fatal: 'remote': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
这个是咋回事呢?
【在 m******t 的大作中提到】 : : Use 'git clone' to clone the repo. : For your local changes (assume you are on master): : $ git checkout -b local : Now you can make your local changes and commit them to : this new local branch. Also work on this branch all the time. : Now when you need to pull down new changes, do: : $ git fetch remote : $ git rebase remote/master master : $ git rebase master local
|
m******t 发帖数: 2416 | 8
Oh, I just put 'remote' as a placeholder. If you didn't
specify any name at clone time, it should be 'origin'.
Also I think in your case a simple 'git fetch' would
work too.
【在 D*********s 的大作中提到】 : #git fetch remote : fatal: 'remote': unable to chdir or not a git archive : fatal: The remote end hung up unexpectedly : 这个是咋回事呢?
|
Z****e 发帖数: 2999 | 9 git stash?
【在 D*********s 的大作中提到】 : 我就想干个简单的事情 : 1,sync with a GIT repo : 2. 保留一两个我的local change不被覆盖 : 我不需要commit, one way sync就好,现在发现很麻烦,这个git还真是得需要 : 学习,不过我 懒得花时间了。
|
D*********s 发帖数: 555 | 10 No, git fetch didn't work, It seemed that git fetch did fetch data but
it didn't merge to my tree.
I feel like I missed something. I'll try again.
【在 m******t 的大作中提到】 : : Oh, I just put 'remote' as a placeholder. If you didn't : specify any name at clone time, it should be 'origin'. : Also I think in your case a simple 'git fetch' would : work too.
|
m******t 发帖数: 2416 | 11
fetch won't do merge. What it does is simply fetching remote changes.
That's exactly why I suggested it instead of pulling directly, because it
then gives you a change to examine the remote changes before merging
them into your local branches, using diff or show-branch.
【在 D*********s 的大作中提到】 : No, git fetch didn't work, It seemed that git fetch did fetch data but : it didn't merge to my tree. : I feel like I missed something. I'll try again.
|