12

Add Existing Project To Git Repo

 3 years ago
source link: https://gist.github.com/alexpchin/102854243cd066f8b88e
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

#Adding an existing project to GitHub using the command line

Simple steps to add existing project to Github.

1. Create a new repository on GitHub.

In Terminal, change the current working directory to your local project.

##2. Initialize the local directory as a Git repository.

git init

Add the files in your new local repository. This stages them for the first commit.

git add .
git add --all

Commit the files that you've staged in your local repository.

git commit -m 'First commit'

Copy remote repository URL field from your GitHub repository, in the right sidebar, copy the remote repository URL.

In Terminal, add the URL for the remote repository where your local repostory will be pushed.

git remote add origin <remote repository URL>

Sets the new remote:

git remote -v

Push the changes in your local repository to GitHub.

git push origin master

Pushes the changes in your local repository up to the remote repository you specified as the origin


Recommend

  • 17

    How to update a forked repo with git rebase – Git Many times you might came across to update/sync your forked repository with main repo. There are multiple ways but below one is very efficient way to sync your forked rep...

  • 6

    Configuring a Git Repo for CI / CD Style Pull Requests Oct 22, 2019 Like a lot of senior software folk, I have a particular se...

  • 18

    Repo coherence with git on NFS and multiple clients All of this talk about NFS got me thinking about an interesting failure mode I saw some time back. Someone else did the work and figured out how it all fit together. I remember...

  • 12
    • shenzilong.cn 3 years ago
    • Cache

    git repo star 列表&备注

    git repo star 列表&备注 star 了之后找又找不到,找到了也不记得当初为啥 star 了,将收藏这种信息放在...

  • 12
    • www.kevinhooke.com 3 years ago
    • Cache

    git tags and pushing to a remote repo

    git tags and pushing to a remote repo Tags are useful to mark specific versions or releases of your code in a repo on a given branch. To tag everything on the current branch, use: git tag new-tag-name

  • 8

    Your Opinion on My First Git Repo Hi devs, I've just created my absolutely first Github repo, and I wanted to get your opinion on it. The concerned project is a Nodejs SDK for web sc...

  • 4
    • opensource.com 3 years ago
    • Cache

    Peek inside your Git repo with rev-parse

    I use Git a lot. In fact, there's probably an argument that I sometimes misuse it. I use Git to power a flat-file CMS, a website, and even my

  • 6
    • racket.discourse.group 3 years ago
    • Cache

    New build system pushed to Git repo

    New build system pushed to Git repo Welcome! This is a friendly and inclusive place to ask questions, show off neat projects, and participate i...

  • 2
    • yaoguais.github.io 2 years ago
    • Cache

    通过vagrant搭建git&repo&lnmp

    通过vagrant搭建git&repo&lnmp 注:使用的操作系统是centos64 6.5,宿主机是Windows. 开发环境不宜使用过多的虚拟机,182.168.1.116是Windows机子,IDE是phpstorm&eclipse. 192.168.1.143配置git,repo,php,nginx,phpmyadmin,samba,phpunit. 也是项目服务器,通...

  • 6

    Setup Octopress from existing repo Dec 8, 2012 从已有的 Octopress repository 重新配置 GitHub Pages 托管博客,比如换了电脑却没有备份原来的设置。要求 source 分支已 push。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK