Git_Clone a remote git repository and cd into it
2012-08-24 14:11
381 查看
First, clone a remote git repository and cd into it:
Next, look at the local branches in your repository:
But there are other branches hiding in your repository! You can see these using the
If you just want to take a quick peek at an upstream branch, you can check it out directly:
But if you want to work on that branch, you'll need to create a local tracking branch:
Now, if you look at your local branches, this is what you'll see:
You can actually track more than one remote repository using
At this point, things are getting pretty crazy, so run
$ git clone git://example.com/myproject $ cd myproject
Next, look at the local branches in your repository:
$ git branch * master
But there are other branches hiding in your repository! You can see these using the
-aflag:
$ git branch -a * master origin/HEAD origin/master origin/v1.0-stable origin/experimental
If you just want to take a quick peek at an upstream branch, you can check it out directly:
$ git checkout origin/experimental
But if you want to work on that branch, you'll need to create a local tracking branch:
$ git checkout -b experimental origin/experimental
Now, if you look at your local branches, this is what you'll see:
$ git branch master * experimental
You can actually track more than one remote repository using
git remote.
$ git remote add win32 git://example.com/users/joe/myproject-win32-port
$ git branch -a * master origin/HEAD origin/master origin/v1.0-stable origin/experimentalwin32/master
win32/new-widgets
At this point, things are getting pretty crazy, so run
gitkto see what's going on:
$ gitk --all &
相关文章推荐
- Moving git repository and all its branches, tags to a new remote repository keeping commits history
- git clone时出现Please make sure you have the correct access rights and the repository exists.错误
- Difference between git remote add and git clone
- 遇到从github git clone不下来,报Permission denied (publickey). fatal: Could not read from remote repository.
- Git Init repository for remote terminal and change the remote master
- Git: untrack a file in local repo only and keep it in the remote repo
- windows下Idea使用git clone failed. Could not read from remote repository
- Git CMD - clone: Clone a repository into a new directory
- How to provide username and password when run "git clone git@remote.git"? - Stack Overflow
- Git+IDEA 克隆项目时出现:Clone failed: Could not read from remote repository.
- Interactive between local repository and remote repository in git
- git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.
- git pull命令更新本地项目的时候遇到“No remote repository specified……”的错误
- Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
- 初学Git_远程克隆github上项目被拒绝--Permission denied (publickey). fatal: Could not read from remote repository.
- git的repository如果太大的话怎么clone
- yum报错: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
- remote: Permission to repository_name.git denied to xxxx.
- Xcode/Git Repository Error: “Please verify that the working copy is reachable and try again.”
- git Could not read from remote repository 解决