0

I have two files (index.html and style.css) in a directory called Bootcamp inside a folder (or directory) within Bootcamp called code-refactoring. I need to push index.html and style.css to GitHub so I'm assuming I first need to cp these two files into my GitHub repo directory before checking the GitHub repo directory git status.

How do I cp those two files from one directory to the other without having to use the mv command?

Austin Coen
  • 11
  • 1
  • 1

1 Answers1

1

EDIT

After seeing your comment, I assume you want to know on how to cp to different folders. There are many ways to it. I will list down one example.

cd to your source directory, and from there you could give the destination's folder path. If you are unsure, you can always give an absolute path to destination folder.

$ cd PATH/TO/SOURCE/FOLDER
$ cp FILENAME PATH/TO/DESTINATION/FOLDER

ORIGINAL

cp -> will make a copy of the file/folder to destination path, preserving the original file.

$ cp SOURCE DEST

mv -> will move the file/folder to destination path, removing the original file.

$ mv SOURCE DEST

Copying a file to the destination folder will create an untracked file. To push the new file, you have to stage the file (git add) and commit it (git commit).

$ git add FILE_NAME
$ git commit -m "Commit message"
$ git push origin master
Ram Pranav
  • 66
  • 1
  • 6