├── README.md ├── basic-git-workflow.md ├── clone-repo.png ├── create-repo.png ├── git-clone.png ├── set-url.png ├── steps-to-clone.MD └── your-dotgit.png /README.md: -------------------------------------------------------------------------------- 1 | # Git Flow 2 | 3 | ## Table of Contents 4 | 5 | **[Cloning a repo and changing the remote url](#Cloning-a-repo-and-changing-the-remote-url)**
6 | **[Basic Git Workflow](#Basic-git-work-flow)** 7 | 8 | ## Cloning a repo and changing the remote url 9 | 10 | (These steps are only for when you initially clone a project repo. Not when you clone your partners repo to collaborate together. To do that, you only have to complete step 1!) 11 | 12 | ### 1. The first step is to clone the repo! 13 | 14 | - Navigate to the repo you want to clone and hit the big green code button. Copy the link given. 15 | 16 | ![clone-repo](./clone-repo.png) 17 | 18 | - Navigate in your terminal to the directory where you want this repo to live. I chose ~/Documents/appAcademy 19 | - `git clone HTTPS://LINKTOURL/THATYOUCOPIED` 20 | 21 | ![git-clone](./git-clone.png) 22 | 23 | ### 2. Sweet, you have the cloned repo in your preferred directory. Now lets make your own repo. On github, create a new repository. 24 | 25 | - Default settings are fine. Hit the big green button `Create Repository` 26 | 27 | ![create-repo](./create-repo.png) 28 | 29 | ### 3. Next, copy the .git link that is on the next page. Do not do any other steps on this page - That is for when you do not clone a repo. 30 | 31 | ![your-dotgit](./your-dotgit.png) 32 | 33 | ### 4. Whenver you clone a repo it already has a .git directory with certain configurations set up. To be able to push this repo to your newly created GitHub repo we have to change the remote origin. 34 | 35 | - To do that, just run this command: (Make sure you are inside the repo you cloned) 36 | 37 | - `git remote set-url origin https://LINK/TO/YOUR/GIT/THAT/YOU/COPIED/FROM/PREVIOUS/STEP.git` 38 | 39 | ![set-url](./set-url.png) 40 | 41 | ### 5. Thats its! You can now run `git push` and it will push to your newly created repo. Try it out :) 42 | 43 | --- 44 | 45 | ## Basic Git work flow. 46 | 47 | - After making changes to a file and you are ready to commit / push to your repo you can run the following commands: 48 | 49 | - `git add .` - stages modifed files to be committed. 50 | - `git status` - displays files that have been modified 51 | - `git commit -m 'A hopefully helpful commit message'` - commits the changes to your local repo. Get in the habit now of making helpfull commit messages 52 | - `git push` - pushes your local commits to your github repo! 53 | 54 | - To pull down changes that your partner pushed to the repo you simply have to run: 55 | - `git pull` - this will fetch the most recent updates! 56 | -------------------------------------------------------------------------------- /basic-git-workflow.md: -------------------------------------------------------------------------------- 1 | # Basic Git work flow. 2 | 3 | - After making changes to a file and you are ready to commit / push to your repo you can run the following commands: 4 | 5 | - `git add .` - stages modifed files to be committed. 6 | - `git status` - displays files that have been modified 7 | - `git commit -m 'A helpfuly commit message'` - commits the changes to your local repo. Get in the habit now of making helpfull commit messages 8 | - `git push` - pushes your local commits to your github repo! 9 | 10 | - To pull down changes that your partner pushed to the repo you simply have to run: 11 | - `git pull` - this will fetch the most recent updates! 12 | -------------------------------------------------------------------------------- /clone-repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesurobertson/git-flow/beb4b38d1737a9f2162c596c529b85a77018577c/clone-repo.png -------------------------------------------------------------------------------- /create-repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesurobertson/git-flow/beb4b38d1737a9f2162c596c529b85a77018577c/create-repo.png -------------------------------------------------------------------------------- /git-clone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesurobertson/git-flow/beb4b38d1737a9f2162c596c529b85a77018577c/git-clone.png -------------------------------------------------------------------------------- /set-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesurobertson/git-flow/beb4b38d1737a9f2162c596c529b85a77018577c/set-url.png -------------------------------------------------------------------------------- /steps-to-clone.MD: -------------------------------------------------------------------------------- 1 | # Steps to clone and change origin to push to your own repo 2 | 3 | ## 1. The first step is to clone the repo! 4 | - Navigate to the repo you want to clone and hit the big green code button. Copy the link given. 5 | 6 | ![clone-repo](./clone-repo.png) 7 | 8 | - Navigate in your terminal to the directory where you want this repo to live. I chose ~/Documents/appAcademy 9 | - `git clone HTTPS://LINKTOURL/THATYOUCOPIED` 10 | 11 | ![git-clone](./git-clone.png) 12 | 13 | ## 2. Sweet, you have the cloned repo in your preferred directory. Now lets make your own repo. On github, create a new repository. 14 | - Default settings are fine. Hit the big green button `Create Repository` 15 | 16 | ![create-repo](./create-repo.png) 17 | 18 | ## 3. Next, copy the .git link that is on the next page. Do not do any other steps on this page - That is for when you do not clone a repo. 19 | 20 | ![your-dotgit](./your-dotgit.png) 21 | 22 | ## 4. Whenver you clone a repo it already has a .git directory with certain configurations set up. To be able to push this repo to your newly created GitHub repo we have to change the remote origin. 23 | - To do that, just run this command: (Make sure you are inside the repo you cloned) 24 | - `git remote set-url origin https://LINK/TO/YOUR/GIT/THAT/YOU/COPIED/FROM/PREVIOUS/STEP.git` 25 | 26 | ![set-url](./set-url.png) 27 | 28 | ## 5. Thats its! You can now run `git push` and it will push to your newly created repo. Try it out :) 29 | -------------------------------------------------------------------------------- /your-dotgit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesurobertson/git-flow/beb4b38d1737a9f2162c596c529b85a77018577c/your-dotgit.png --------------------------------------------------------------------------------