如果我在几个分支的git下都有软件,则在运行代码时将使用哪个代码?将使用主机,还是最后提交更改的主机?
您可以使用以下方法进行测试:
mkdir test
cd test
vim test.R
print("hi") # save with ESC, CTRL+x
git add test.R
git commit -m "Adding file"
git branch newbranch # create new branch
git checkout newbranch # switch to the new branch
vim test.R # edit the file on the new branch
print("bye") # save with ESC, CTRL+x
cd ..
cat test/test.R
print("bye")
R CMD BATCH test.R # Run the program with an external application
cat test.Rout # observe the output
> print("bye")
[1] "bye"
因此,即使未提交更改,也会使用您正在处理的分支。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句