Tagged: git Toggle Comment Threads | Keyboard Shortcuts

  • jess 1:44 pm on February 9, 2015 Permalink | Reply
    Tags: git   

    Create a new Git repo from and old repo 

    How to extend an old repository as a full copy in a new repository. This preserves the history of the old repository. Future changes will not affect the old repository, but will be committed to the new repository.

    This originally came from the info found at: http://stackoverflow.com/questions/10963878/how-do-you-fork-your-own-project-on-github

    // This makes the new repo as a checkout of the old repo to a new directory.
    # git clone https://github.com/nicholls-state-university/nicholls-2012-core.git nicholls-2015-core
    // Change directory to new repo area
    # cd nicholls-2015-core
    // Change the origin to the new repo. Remember to make the new repo area.
    # git remote set-url origin https://github.com/nicholls-state-university/nicholls-2015-core.git
    // Push commits to new area.
    # git push origin master
    // Push all changes to repo, just making sure.
    # git push --all
    
     
  • jess 3:23 pm on January 20, 2015 Permalink | Reply
    Tags: git   

    Git local repositories 

    These are some quick examples and notes related to using git with local repositories. Using local repositories can be helpful maintaining file changes without committing to larger repository systems like Github. Instead of syncing with a remote repository, synchronization and changes are committed to the local repository and recorded.

    First we create a new local folder and initialize it as blank Git repository.

    # mkdir my-local-git
    # cd my-local-git
    # git init —bare
    

    Then we just clone that to the location we want and work on it like any other git repository.

    # git clone /where/is/my-local-git
    
     
  • jess 1:46 pm on August 7, 2014 Permalink | Reply
    Tags: git   

    Git subproject notes 

    I want  to use a project as a tool-set for a big ole work project. The sub-project isn’t mine, I don’t have access to the code, I will probably need to update it as a component of my big project.

    Some good reading here: https://hpc.uni.lu/blog/2014/understanding-git-subtree/

    Some of my first tip-toe basic understanding.

    # Straight subtree pulls the dependency into local directory
    git subtree add --prefix CMB2 https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress.git master --squash
    

    Apparently this can get better if you use the

    git remote[\code] command.
    
    
    # Setup dependency as a remote
    git remote add -f Custom-Metaboxes-and-Fields-for-WordPress https://github.com/WebDevStudios/CMB2.git
    
    # Fetch information about remote
    git fetch Custom-Metaboxes-and-Fields-for-WordPress master
    
    # Add remote to subdirectory and pull master branch
    git subtree add --prefix=CMB2 --squash CMB2/master
    
    # Update remote down into local directory
    git subtree pull --prefix CMB2 CMB2 master --squash
    

    With the remote added we should be able to update the dependency project by doing a subtree pull. Remember the sub-project is not mine but it will need updating.

    git subtree pull --prefix Custom-Metaboxes-and-Fields-for-WordPress Custom-Metaboxes-and-Fields-for-WordPress master --squash
    
     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel