search

Home  >  Q&A  >  body text

Why didn't I push the wp folder to my github?

Not to mention the previous steps, create a new Github account, create a new warehouse, generate a key with ssh-keygen, upload the pub key, and copy the contents of the id_rsa.pub file to github.

1.ssh -T git@github.com successfully connected

2. Established github repository

The text begins.
I want to push all the stuff in the wp folder to github.

1.git clone https://github.com/yufeiluo/n...
Initial state:

ls  /home/debian8/newstart
LICENSE  README.md

2. Copy the wp folder and its contents to local newstart
Before copying

After copying

3. Start git on this machine

git init
git commit -m 'newstart'
git remote add origin https://github.com/yufeiluo/newstart.git
git push origin master
Username for 'https://github.com': yufeiluo
Password for 'https://yufeiluo@github.com': 
Everything up-to-date

All operations are completed, open github.

The files in wp are not pushed to github. What is the reason?

曾经蜡笔没有小新曾经蜡笔没有小新2791 days ago673

reply all(3)I'll reply

  • 某草草

    某草草2017-05-02 09:47:56

    After you have established the local warehouse and added the remote warehouse, the steps to submit using git are as follows:

    • Add to staging area

    git add <你要提交的文件>

    Or submit all modified or newly added files directly:

    git add .
    • Submit this modification

    git commit -m "你的提交信息"

    Or skip the first step and go directly:

    git -am "你的提交信息"
    • Push to remote warehouse

    git push origin master

    In addition, as mentioned on the first floor, there is no need to use git remote add ...add the URL of the cloned warehouse for the cloned warehouse. Unless, that URL is for another remote warehouse.

    reply
    0
  • 阿神

    阿神2017-05-02 09:47:56

    You don’t have git add and git commit.

    These are all basic operations.

    In addition, you cloned it directly, so don’t do git init and git remote add... anymore.

    reply
    0
  • 为情所困

    为情所困2017-05-02 09:47:56

    After you have established the local warehouse and added the remote warehouse, the steps to submit using git are as follows:

    View current warehouse status:

    git status

    Add to staging area

    git add <file>

    Or submit all modified or newly added files directly:

    git add .

    Submit this change

    git commit -m "你的提交信息"

    Then push to the remote warehouse

    git push -u origin master

    If push fails, you can try

    git pull origin 分支

    Then push.

    reply
    0
  • Cancelreply