开发者

git confusion - cloning a repo is returning a past version

开发者 https://www.devze.com 2022-12-11 06:30 出处:网络
Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version.

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. when I do 'git log -n1' to see what the latest commit info of the new开发者_C百科 repo (the clone) it matches the original repo that I cloned (the latest commit info), so thats confusing me even more since git is indicating that both are the latest versions. Im using git 1.5.4.3 on ubuntu server. any ideas

thanks


First make sure all changes are committed on the remote repository.

git add .
git commit -m "my commit message"

Running git status should show no uncommitted changes.

Then on your local copy try running

git pull origin master #or whatever branch you're on

You can list branches by running

git branch -a

The -a shows local branches and those from the repository you cloned from.

It you need to switch to another branch on the from the remote repository you need to set up a local tracking branch first. The command will look something like:

git branch --track my_branch origin/my_branch
git checkout my_branch

When in doubt run

git pull origin master #or whatever branch you're on

This would bring your local working copy up to date with the remote repository.


Are you on the same branch as the other repo?

(you get master by default, and newer commits in other branch aren't possibly hidden until you switch.)


That could possibly happen if you have inconsistent treating of newlines (core.autocrlf).

Make a simple change (add a line into one of your files).

Paste here what git diff, git status, cat .git/config say on and what is the exact output of git commit -am "test"

0

精彩评论

暂无评论...
验证码 换一张
取 消