# Git Bash & GitHub

**URL:** <https://forum.freecodecamp.org/t/git-bash-github/433209>\
**Category:** General\
**Created:** [December 1, 2020, 9:01pm UTC](https://forum.freecodecamp.org/t/git-bash-github/433209 "2020-12-01T21:01:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![christiesunnie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/christiesunnie/32/186907_2.png) [@christiesunnie](https://forum.freecodecamp.org/u/christiesunnie)\
**Post date:** [December 1, 2020, 9:01pm UTC](https://forum.freecodecamp.org/t/git-bash-github/433209/1 "2020-12-01T21:01:58Z")

</div>

Hi guys,  
I have a question about pushing the local directories into GitHub by Git Bash.  
I have a local folder which contains a couple of sub-folders with different files in each sub-folder.  
I want to push all of them onto GitHub but I can’t do it. I just could push only 1 folder which contains the files only.

**The error is "error: failed to push some refs to '[https://github.com/christiesunnie/vanilla-js-projects.git](https://github.com/christiesunnie/vanilla-js-projects.git)’**  
\*\*hint: Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes (e.g., ‘git pull …’) before pushing again. See the ‘Note about fast-forwards’ in ‘git push --help’ for details."

Can someone help me how to do this please?

P/s: I attach an example of what I meant from GitHub

 ![Untitled](https://global.discourse-cdn.com/freecodecamp/original/3X/4/7/4759c9a0ffeda152119f87094964b4d3c7d8ef2c.png)

Thank you so much!

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [December 1, 2020, 9:05pm UTC](https://forum.freecodecamp.org/t/git-bash-github/433209/2 "2020-12-01T21:05:00Z")

</div>

Have you done a `git pull` or `git fetch`?

---

<div class="post-metadata">

**Author:** ![christiesunnie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/christiesunnie/32/186907_2.png) [@christiesunnie](https://forum.freecodecamp.org/u/christiesunnie)\
**Post date:** [December 1, 2020, 9:27pm UTC](https://forum.freecodecamp.org/t/git-bash-github/433209/3 "2020-12-01T21:27:50Z")

</div>

Hi. I am pretty new with GitHub and Git Bash.  
Do you have any instructions for me?

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [December 1, 2020, 9:34pm UTC](https://forum.freecodecamp.org/t/git-bash-github/433209/4 "2020-12-01T21:34:29Z")

</div>

It sounds like what has happened is that changes have been submitted to the remote repository. Your remote branch is “ahead” of your local one. Before you can submit your local changes, you need to get your code up to date. There are commands that let you get the most recent code from the remote repository. Here is a freeCodeCamp article to explain them:

> **[Git Fetch vs Pull: What's the Difference Between the Git Fetch and Git Pull...](https://www.freecodecamp.org/news/git-fetch-vs-pull/)**
>
> Git pull and fetch are two commands that are regularly used by Git users. Let’s see the difference between both commands. For the sake of context, it’s worth remembering that we’re probably working in a clone repo. What’s a clone? It's simply a...

---

<div class="post-metadata">

**Author:** ![christiesunnie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/christiesunnie/32/186907_2.png) [@christiesunnie](https://forum.freecodecamp.org/u/christiesunnie)\
**Post date:** [December 1, 2020, 10:01pm UTC](https://forum.freecodecamp.org/t/git-bash-github/433209/5 "2020-12-01T22:01:30Z")

</div>

I will tell you steps by steps I did.

I created a folder at my local laptop:  
vanilla-js-projects (folder) -\> beginner (folder) -\> bin2dec-app (folder)

in bin2dec-app (folder) contains 3 file HTML, JS and CSS files

I used GitBash to initialize the git

git init  
git add .  
git commit -m “Add the folders for the projects”  
git remote add origin GitHub URL  
git push -u origin master

-\> So at the moment, on my GitHub,  
beginner folder has pushed with bin2dec-app folder inside it

However, bin2dec-app folder can’t be accessed.

Do you know what is the problem?

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 6:36pm UTC](https://forum.freecodecamp.org/t/git-bash-github/433209/6 "2021-06-01T18:36:34Z")

</div>


