diff --git a/commit.md b/commit.md index 5eda6ec..78dc299 100644 --- a/commit.md +++ b/commit.md @@ -1,3 +1,4 @@ +# Committing Code ## Adding files Before you can commit your work to local or remote repositories you need to make sure git is tracking the file you have changed, otherwise those changes won't sync. To add a specific file to the git repository run the command: diff --git a/getting-code.md b/getting-code.md index 7a64a03..cbfb228 100644 --- a/getting-code.md +++ b/getting-code.md @@ -34,22 +34,32 @@ Lets look at how you can set up a new remote repository on Gitlab/Github, so you > If you want to just pull the code down to use locally you can use HTTPS, this is especially useful if you don't have permissions on the repository. + ### Clone the new repository +Now you have the URL you can go back to your terminal and clone the repository. + ```bash git clone git@gitlab.com:ric_harvey/demo-project.git ``` +you are now ready to get going committing code! Head over to the [commit.md](./commit.md) file for information on what to do next. + ### Adding existing files to a git repository +Now if you have already been working hard and you have files already you can import these files. By following the following instructions. You'll still need that SSH URL you copied. + ```bash -cd existing_repo +cd existing_directory +git init git remote add origin https://gitlab.com/ric_harvey/demo-project.git git branch -M main +git add . +git commit -m "first commit" git push -uf origin main ``` -## Cloning an existing repository +This will now sync all your your files up to the remote repository. --- ##### Follow me for more guides