`
wbj0110
  • 浏览: 1556085 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

How to switch repositories from one to the next

阅读更多

You can use git remote to manage your remote

  • rename origin
    git remote rename origin old_origin
  • add a new origin
    git remote add origin git://github.com/my/forked/repo.git
    git fetch origin # will create all the remote branches references 
                     # in your local repo

 

git branch --set-upstream master origin/master

The "nothing to commit (working directory clean)" message of git status won't prevent you to push.
After changing the origin, you should see:

$ git status
# On branch master# Your branch is ahead of 'origin/master' by xxx commits.#
nothing to commit (working directory clean)

That means you have some commits to push to your new origin.

 

 

 

 

 

分享到:
评论

相关推荐

    Gradle.Dependency.Management.1784392782

    You will learn how to configure the publication of artifacts to different repositories. Packed with plenty of code samples, you will understand how to define the repositories that contain ...

    Git Version Control Cookbook 2nd Edition

    In addition to this, you’ll learn how to extract metadata from repositories and automate your daily tasks using Git hooks. You’ll then study in detail repository maintenance, patching, and offline ...

    Android代码-material-animated-switch

    How to use By default show the inbox pinned switch With custom colors and icons attributes Remember put this for custom attribute usage xmlns:app="http://schemas.android.com/apk/res-auto" For ...

    a project model for the FreeBSD Project.7z

    It contains information about where to fetch the source, what patches to apply and how, and how the package should be installed on the system. This allows automated tools to fetch, build and install ...

    Learning Docker - Second Edition

    how to push images to Docker Hub, the automatic building of images, how to create organizations on Docker Hub, and finally private repositories. Chapter 5, Running Your Private Docker Infrastructure,...

    Git.Mastering.Version.Control.pdf

    As you progress on to the next module, you will learn how you can automate the usual Git processes by utilizing the hook system built into Git. It also covers advanced repository management, including...

    Beginning Artificial Intelligence with the Raspberry Pi-Apress(2017).pdf

    The second one uses a Pi Camera with a Raspberry Pi to image a hand-written number and then uses the previously trained ANN to determine the closest match. Chapter 10 deals with evolutionary ...

    Git Recipes

    With recipes to cover any task you can think of, including working with GitHub and git on BitBucket, Git Recipes shows you how to work with large repositories, new repositories, forks, clones, ...

    Jenkins Fundamentals

    In addition to this, you will create a secure connection from your master to your build slaves and configure your build tasks to run on the slave. By the end of this book, you will be able to ...

    Git-2.21.0-64-bit.zip

    * "git fetch" that grabs from a group of remotes learned to run the auto-gc only once at the very end. * A handful of Windows build patches have been upstreamed. * The code to read state files ...

    Android代码-Android-PGP

    How to install repositories { maven { url "https://jitpack.io" } } dependencies { implementation 'com.github.kibotu:android-pgp:-SNAPSHOT' } How to use 1.1 Generate a Key-Pair val krgen = Pgp....

    Swift Essentials (2nd Edition, 2016)

    Swift was considered one of the biggest innovations last year, and certainly with Swift 2 announced at WWDC in 2015, this segment of the developer space will continue to be hot and dominating. ...

    The.Docker.Book.B00LRROTI4_v1.10.3

    We're going to take you through the development life cycle, from testing to production, and see where Docker fits in and how it can make your life easier. We'll make use of Docker to build test ...

    mastering-spring-cloud2018

    will learn how to enable different backend repositories of property sources and push change notifications using Spring Cloud Bus. We will compare discovery first bootstrap and config first bootstrap ...

    Beginning Jenkins Blue Ocean: Create Elegant Pipelines With Ease

    What You Will Learn Discover Jenkins Blue Ocean and how to use it Create elegant pipelines using the visual pipeline editor Work with the declarative pipeline syntax Use tools that help you write ...

    pragmatic guide to git

    New Git users will learn the basic tasks needed to work with Git every day, including working with remote repositories, dealing with branches and tags, exploring the history, and fixing problems when...

    Jenkins Essentials.pdf

    From there, you'll integrate code repositories, applications, and build tools for the implementation of continuous integration. Finally, you'll explore the automated deployment of an application in ...

    Swift.Essentials.2nd.Edition.178588887

    Swift was considered one of the biggest innovations last year, and certainly with Swift 2 announced at WWDC in 2015, this segment of the developer space will continue to be hot and dominating. ...

    GitHub.Essentials.1783553715

    Unleash the power of collaborative development workflow using GitHub, one step at a time About This Book Effectively use GitHub by learning its key features that leverage the power of Git and make ...

Global site tag (gtag.js) - Google Analytics