Menu

[ea00bd]: / scm-git / git-using.txt  Maximize  Restore  History

Download this file

69 lines (37 with data), 2.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
First Time Stuff
You only do these steps when you are FIRST setting up a place to work with the repo. After that, you always use the section below called Every Time You Work in the Repo.
1. DL git if not already on your OS at: https://git-scm.com/downloads There are GUI clients for all OS's, but my way is really easy.
2. Create a Sourceforge account so you can commit changes by going to sf.net, and at top left clicking Join.
3. Create & cd to a dir you want the repo to be copied into.
mkdir myrepos
cd myrepos
4. At the slack repo top page here: https://sourceforge.net/p/msp-powershell-scripts/code/ci/master/tree/ click on either SSH or HTTPS (depending your preference). Doing so changes the code at the right of these buttons. Whichever you select, copy that text. It will look something like (if you selected SSH):
---> NOTE: BELOW IS WITH MY ID (theitguys). YOU WILL NEED WHAT IT SAYS IN THE COPIED TEXT <---
git clone ssh://theitguys@git.code.sf.net/p/msp-powershell-scripts/code msp-powershell-scripts-code
...and if you selected HTTPS:
git clone https://theitguys@git.code.sf.net/p/msp-powershell-scripts/code msp-powershell-scripts-code
5. This will make for you a directory called msp-powershell-scripts-code, so cd into that. We'll also identify where it will get changes from:
cd msp-powershell-scripts-code
Depending on whether you used SSH or HTTPS, do one of these:
git remote add upstream ssh://theitguys@git.code.sf.net/p/msp-powershell-scripts/code
...or...
git remote add upstream https://theitguys@git.code.sf.net/p/msp-powershell-scripts/code
That is it! Congrats!
You only do this the first time.
Stuff this part away until next time!
Every Time You Work in the Repo
Here all we do is grab the latest, with everyone's changes, work with it, then push our changes back up.
1. You want to make sure you have the latest each time you work in the repo, so do:
cd myrepos\msp-powershell-scripts-code
git pull upstream master
2. Make your add, edits, deletes, make new folders, rename existing-go crazy!
3. When done, go back to the top repo directory:
cd msp-powershell-scripts-code
4. Tell git we want to add our changes to the repo ("." means all):
git add .
5. Add some text to tell others what we did ("-m" is for message):
git commit -m "I changed foo.bar and added bar.foo"
6. Finally, push the changes to the master repo:
git push origin master
Done.
Now wasn't that easy?
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.